SQL ORDER BY mixing 2 columns
SELECT retrn, speco, grpdc, Case When grpdc <> ' ' Then grpdc Else speco End As column4 FROM mrcdct15 ORDER BY 4
1. A
2. A
3. C
4. D
5. D B
And you want the records to sorted as :
1, 2, 5, 3, 4
0 Comments:
Post a Comment
<< Home