Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 select distinct query

Author  Topic 

reddymade
Posting Yak Master

165 Posts

Posted - 2006-06-05 : 16:47:18
I have the following query:

select distinct contentid, seller from table_contents

But it brings multiple records with same contentid.

I want the contentid records to be unique, is it possible.

Thank you very much for the info.

X002548
Not Just a Number

15586 Posts

Posted - 2006-06-05 : 16:59:43
Which seller data do you want? You need to make a decision.

You can say

SELECT contentid, MAX(seller) from table_contents GROUP BY contentid




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-06 : 04:23:35
or Post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -