Hi! I have table with data, but now I want order by id and name.
DROP TABLE #PERSON
CREATE TABLE #PERSON(Id INT, NAME VARCHAR(10), SALARY FLOAT)
INSERT INTO #PERSON(Id, NAME, SALARY)
SELECT 1,'Bahodur', 150
UNION ALL
SELECT 2,'Amonullo', 200
UNION ALL
SELECT 3,'Sadriddin', 230
UNION ALL
SELECT 4,'Asror', 280
UNION ALL
SELECT 5,'Komron', 330
SELECT * FROM #PERSON order by id, NAMEDROP TABLE #PERSON
CREATE TABLE #PERSON(Id INT, NAME VARCHAR(10), SALARY FLOAT)
INSERT INTO #PERSON(Id, NAME, SALARY)
SELECT 1,'Bahodur', 150
UNION ALL
SELECT 2,'Amonullo', 200
UNION ALL
SELECT 3,'Sadriddin', 230
UNION ALL
SELECT 4,'Asror', 280
UNION ALL
SELECT 5,'Komron', 330
SELECT * FROM #PERSON order by id, NAME
Output result:
Id
|
NAME
|
SALARY
|
1
|
Amonullo
|
200
|
2
|
Asror
|
280
|
3
|
Bahodur
|
150
|
4
|
Komron
|
330
|
5
|
Sadriddin
|
230
|