Friday 31 August 2012

Top query | Order by | ascending | descending order in sql server 2005-2008

How to write Top query | Order by | ascending | descending order in sql server 2005-2008.

SELECT        TOP (1) cl_id, cl_name, cl_lst_name, cl_phone, cl_sal
FROM            clnt_tb
ORDER BY cl_lst_name DESC

or

SELECT        TOP (1) * from clnt_tb order by cl_lst_name desc

1ramsingh89897999910000
NULLNULLNULLNULLNULL
SELECT        TOP (2) * from clnt_tb order by cl_lst_name desc
or

ELECT        TOP (2) cl_id, cl_name, cl_lst_name, cl_phone, cl_sal
FROM            clnt_tb
ORDER BY cl_lst_name DESC

1ramsingh89897999910000
3ramayanrahi44343434312345

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: