Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

SQL Custom sorting

I need to be able to custom sort values that come from a query basically i have a query like this


SELECT Name from Table

and i want to be able to custom order the values

Ideally, it would add an extra field to the SQL query at runtime so the result would be something like this

Name             SortOrder
------------------------------------
John               1
Sam               2
Susan           3
Andy            4
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Expand on 'custom sort'.  Are you trying to get an incrementing integer value for each name, or establishing a sort order other than A-Z name?
Avatar of vbnetcoder
vbnetcoder

ASKER

establishing a sort order other than A-Z name?
sorry: My comment was a statement in answer to your question not intended to be a question.
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial