The ASC keyword is
used to sort the record in ascending order. This keyword is used with the ORDER
BY expression
Syntax:
SELECT column1,
column2.... FROM your_table_name ORDER BY column_name ASC;
Example:
Id
|
Name
|
Age
|
Address
|
1
|
Alok Kumar Singh
|
30
|
IN
|
2
|
Tomas Paul
|
45
|
NZ
|
3
|
Cristomfer Dee
|
85
|
AU
|
4
|
Niel Macengi
|
55
|
US
|
USE SQLCLR
GO
SELECT * FROM EMPLOYEE ORDER BY Name ASC
GO
Id
|
Name
|
Age
|
Address
|
Department
|
Gender
|
1
|
Alok Kumar Singh
|
30
|
IN
|
IT
|
Male
|
3
|
Cristomfer Dee
|
85
|
AU
|
HR
|
Female
|
4
|
Niel Macengi
|
55
|
US
|
BPO
|
Female
|
2
|
Tomas Paul
|
45
|
NZ
|
IT
|
Male
|
No comments:
Post a Comment
Note: only a member of this blog may post a comment.