Click here to Skip to main content
15,919,178 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
id | value
----------
 4 | 100
 4 | 200
 4 | 300
 7 | 100
 10| 100
 4 | 400
 10| 200
 7 | 200
 7 | 300
 8 | 100
 10| 300

i want the output
 id | value
----------
 4 | 100
 4 | 200
 4 | 300
 4 | 400
 7 | 100
 7 | 200
 7 | 300
 8 | 100
 10| 100
 10| 200
 10| 300


What I have tried:

need help to get it in proper sql
Posted
Updated 2-Jul-21 0:19am
Comments
FranzBe 2-Jul-21 6:12am    
Have a look here: https://www.w3schools.com/sql/sql_orderby.asp

1 solution

Try:
SQL
SELECT Id, Value
FROM MyTable
ORDER BY Id ASC, Value ASC
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900