I have a list of feeds:
('feed1', 'feed2', 'feed3')
I also have a table feeds with a list of feeds, I need to find which feeds in my search list don’t appear in the database.
CREATE TABLE `feeds_filtered` (
`id` CHAR(36) NOT NULL,
`url` VARCHAR(255) NOT NULL,
......
PRIMARY KEY (`id`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8;
For example feed1 and feed3 exist in my table so I want feed 2 returned.
Please note: that the feeds table also has feed4, feed5 etc so I don’t want them returned either. Only feed2
I can easily write a PHP script to do this, but I was wondering if there was an easy way to do this is MySQL?
Thanks in adavnce!
You could create a temporary table, do a
LEFT JOIN, then get the records where the RHS of the join isNULL.