[thelist] SQL Madness! Many-to-many selection

Anthony Baratta Anthony at Baratta.com
Fri Aug 17 15:38:24 CDT 2001


At 01:37 PM 8/17/2001, you wrote:
>I have events in one table, and categories in another.
>
>Each category has a distinct url and a name.
>
>What I am trying to do is select the latest events and grab the information
>for exactly one category in which it exists, without selecting the same
>event more than once.

There might be a better way, but this is what I would try.

Select Distinct URL from Table_One, Table_Two
Where Table_One.URL_ID = Table_Two.URL_ID
AND Table_Two.Category in ('Cat_1','Cat_2','Cat_3')
---
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."





More information about the thelist mailing list