Click here to Skip to main content
15,888,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all
i have a select query :

select Businessid from tblBusinessRatingandReviews


it give following result:

30
30
30
20
20
20
20


i want the only 30 and 20 come in result:

thanx in advance..
Posted

1 solution

Hi,

Use DISTINCT keyword.
SQL
select DISTINCT Businessid from tblBusinessRatingandReviews


Thanks,
Imdadhusen
 
Share this answer
 
Comments
balongi 7-Feb-11 23:48pm    
i have another quey in case of
select Distinct Businessid, UserId from tblBusinessRatingandReviews
than duplicate businessid also come
Sunasara Imdadhusen 8-Feb-11 0:20am    
It will return Unique combination of BusinessID and UserID
balongi 8-Feb-11 4:27am    
But it will display duplicate businessid and userid
Sunasara Imdadhusen 9-Feb-11 0:11am    
It can not possible!!

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