Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

How to sort a varchar column that contains numbers and letters in SQL Server?

$
0
0

I have a varchar column that contain numbers (1-99999) and letters (AM0001-BF9999).

Since it has letters so i can't just convert it to int.

Is there a way to maybe use grouping_id to sort this column by numbers (small to large) then follow by letters (alphabetically)?

Thanks.


Viewing all articles
Browse latest Browse all 7129

Trending Articles