Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get only unique ids 1

Status
Not open for further replies.

RobBroekhuis

Technical User
Oct 15, 2001
1,971
US
I'm sure this is simple, but I'm new to SQL, especially to queries involving more than one table. I have the following query:

select threads.threadid from posts,threads where posts.threadid=threads.threadid and (text like '%quote%' or subject like '%quote%') order by threadid desc

where threadid is the primary key for table threads, and any threadid can occur one or more times in posts. text is a field in posts, subject is a field in threads. How do I modify this query so that each threadid is only returned once?


Rob
[flowerface]
 
Works fine. You came through for me again. Thanks!

Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top