SELECT ColumnName(s) FROM TableName Order by ColumnName Asc|Desc
Example 1:
--ascending order
select ('Rudi')FootBallTeam union
select ('Anton') union
select ('Budi') union
select ('Cahya') union
select ('Yahya') Order by FootBallTeam Asc
#Results:
FootBallTeam
Anton
Budi
Cahya
Rudi
Yahya
Example 2:
--descending order
select ('Rudi')FootBallTeam unionselect ('Anton') union
select ('Budi') union
select ('Cahya') union
select ('Yahya') Order by FootBallTeam Desc
#Results:
FootBallTeam
Yahya
Rudi
Cahya
Budi
Anton
Tidak ada komentar:
Posting Komentar