[thelist] SQL question
Jay Blanchard
jblanchard at pocket.com
Mon May 1 10:25:47 CDT 2006
[snip]
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
this
possible just using SQL? I'm using MySQL so I can use proprietary
commands
if need be.
I was thinking something like SELECT * FROM categories, categories WHERE
category = "cheese" AND category = "stilton" (so combining the same
table
twice) but this isn't allowed.
[/snip]
SELECT * FROM categories
WHERE category LIKE '%stilton%' OR path LIKE '%stilton%'
More information about the thelist
mailing list