List:General Discussion« Previous MessageNext Message »
From:João Cândido de Souza Neto Date:June 19 2006 4:00pm
Subject:Re: Find rows in table A where table B = 'hello' AND table B = 'world'
View as plain text  
select a.urlid,a.keywordid,b.url,c.keyword from tbl_url_keyword a inner join 
tbl_url b on a.urlid=b.urlid inner join tbl_keyword c on 
a.keywordid=c.keywordid where c.keyword="mysql" or c.keyword="databases" or 
c.keyword="tutorial";



"David Otton" <member@stripped> escreveu na mensagem 
news:12137689.1150731224508.JavaMail.www@ style="color:#666">stripped...
> That's a lousy subject line, but I don't know how to describe this 
> problem. I've been banging my head against this for a couple of days, and 
> I'm certain there's a simple solution I'm missing.
>
> I've got a URL table, a keyword table, and a joining table, so each URL 
> has a list of keywords applied to it, and each keyword can be applied to 
> many URLs:
>
> tbl_url
> -------
>
> INT urlid,
> VARCHAR url
>
> tbl_keyword
> -----------
>
> INT keywordid,
> VARCHAR keyword
>
> tbl_url_keyword
> ---------------
>
> INT urlid,
> INT keywordid
>
> How do I find all the tags that are tagged with the words "mysql" AND 
> "databases" AND "tutorial"?
>
> It seems so simple, I can't believe it's caused me so much grief.
>
> 


Thread
Find rows in table A where table B = 'hello' AND table B = 'world'David Otton19 Jun
  • Re: Find rows in table A where table B = 'hello' AND table B = 'world'joao19 Jun
  • Re: Find rows in table A where table B = 'hello' AND table B = 'world'Peter Brawley19 Jun