[thelist] SQL question

Jay Blanchard jblanchard at pocket.com
Mon May 1 10:25:47 CDT 2006

If I wanted to search for a path where category is "stilton" and for the
same path the category "cheese" (so the result would be /stilton) is
possible just using SQL? I'm using MySQL so I can use proprietary
if need be.

I was thinking something like SELECT * FROM categories, categories WHERE
category = "cheese" AND category = "stilton" (so combining the same
twice) but this isn't allowed.

SELECT * FROM categories 
WHERE category LIKE '%stilton%' OR path LIKE '%stilton%' 

More information about the thelist mailing list