Click here to Skip to main content
15,907,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all i am using following sql query

select distinct tblBusinessRatingandReviews.businessid,  tblBusinessRatingandReviews.UserId,tblBusinessRatingandReviews.businessratingcreationdate as date  FROM tblBusinessRatingandReviews  inner join tblBusinesses on tblBusinessRatingandReviews.BusinessId = tblBusinesses.BusinessId  


it produced result as

30  16  2010-01-29 13:43:21.640
30  16  2010-01-29 14:57:08.390
30  16  2010-01-29 15:00:33.060


See i want it will not displayed duplicate business id how i do this?

Thanks in advance!
Posted

1 solution

This is happening because the date is different (distinct) for each row.

You need to restructure the query for exactly what you want.

Maybe use GROUP BY businessid

It depends on what you are trying to determine from the data.
 
Share this answer
 
Comments
balongi 8-Feb-11 5:19am    
i use group by businessid but the duplicate businessid come again

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