id name
1 NA
2 jay
3 pole
how to do that name in alphabetical order and i don't wanna change that constant name in 'NA'
without NA how to Order By using
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
HanookPosted Oct 31, 2013, 1:23 AM
SELECT id, name
FROM TableName
ORDER BY CASE WHEN name = 'NA' THEN CAST(1 AS VARCHAR) ELSE name END
Safeer SafeerPosted Oct 31, 2013, 2:47 AM
HanookPosted Oct 31, 2013, 1:50 AM
Safeer SafeerPosted Oct 31, 2013, 1:29 AM
Safeer SafeerPosted Oct 31, 2013, 1:08 AM
can u explain that sql query
Sanjeeb LenkaPosted Oct 31, 2013, 12:29 AM
just use asc or desc in your select query then bind it to combo box.
Note: as NA is the default don't take it from database. after binding the data to combobox just insert the NA in index possition 0.