[thelist] SQL question

Brian Cummiskey Brian at hondaswap.com
Mon May 1 10:27:56 CDT 2006


Kevin Sedgley wrote:

> 
> 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.

It certainly IS allowed, but you don't need to express the table twice.

SELECT
	*
FROM
	categories
WHERE
	category IN ("cheese","stilton")




More information about the thelist mailing list