Friday 31 August 2012

Order BY | Ascending | descending query in sql server 2005-2008

SELECT        cl_id, cl_name, cl_lst_name, cl_phone, cl_sal
FROM            clnt_tb
ORDER BY cl_lst_name


or

select * from  clnt_tb order by cl_lst_name


2ramahihi88698889
3ramayanrahi44343434312345
1ramsingh89897999910000

SELECT        cl_id, cl_name, cl_lst_name, cl_phone, cl_sal
FROM            clnt_tb
ORDER BY cl_lst_name DESC

or

select * from  clnt_tb order by cl_lst_name  desc

1ramsingh89897999910000
3ramayanrahi44343434312345
2ramahihi88698889
so , we got the idea how to use order by in  sql server with ascending order and descending order .
by default query execute ascending order.
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: