Click here to Skip to main content
15,908,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello frnds,

I want to use Distinct, where , groupby and orderby in single query in sqlserver 2005.

Please can you help me. thanks.
Posted

Try Something like

SQL
Select Distinct (ColumnName)
from TableName
where ColumnName > 1 //Change the Condition
group by ColumnName
order by ColumnName Desc
 
Share this answer
 
u can use like this.......

select distinct columnname,........
from tablename
where.....
group by....
order by columnname desc/asc
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900