Sunday, March 28, 2010

Code to retrieve distinct fields from table


with t1 as
(select top 1000 * from photogallery where category<>'movieposters' and category<>'others'
and category<>'spicy' order by cid desc)

select distinct top 5 name from t1

--
R Chakrapani Raju
Web Programmer
Alip Infotech Pvt Ltd
www.cinehour.com

No comments: