Hi I'm trying to solve a problem with negating data I have two tables
Classes:
+----+----------+--+
| id | name | |
+----+----------+--+
| 1 | 'First' | |
| 2 | 'Second' | |
+----+----------+--+
Lists:
+----+----------+--+
| id | id_class | |
+----+----------+--+
| 1 | 1 | |
+----+----------+--+
class id references id_class
and I want to select the data that is not in the lists table. I tried this:
SELECT c.name FROM classes c JOIN lists l ON (l.id_class=c.id) WHERE l.id_class!=c.id
But no result, guess it's not correct Any solutions ?