Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Mysql query question

Aloittaja JayRoe, heinäkuu 03, 2008, 05:42:13 IP

« edellinen - seuraava »

JayRoe

Is it possible to do something like this:
SELECT * FROM releases WHERE labels NOT INTERSECT $exludeList

The labels fields are strings with four integers. Ie. "1, 34, 73, 66"

Thanks for reading.  :)

Tony Reid

I think you need "not in" rather than intersect

SELECT * FROM releases WHERE labels NOT IN ('1', '34','73','66');

Tony Reid

JayRoe

Thanks for the swift reply. Won't that return a false if the label is "1,3,6" and the exclude list is "1,2,3,4,8,9"?
I mean in this example the string "1,3,6" is not to be found in the exclude list.

Advertisement: