Advertisement

Latest Post

Sunday, 18 September 2016

How to use DESC keyword in Sql

The DESC keyword is used to sort the record in descending order. This keyword is used with the ORDER BY expression. 
Syntax:
SELECT column1, column2.. FROM your_table_name ORDER BY column_name DESC;
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 DESC

GO

Id
Name
Age
Address
Department
Gender
2
Tomas Paul
45
NZ
IT
Male
4
Niel Macengi
55
US
BPO
Female
3
Cristomfer Dee
85
AU
HR
Female
1
Alok Kumar Singh
30
IN
IT
Male


Government Jobs