I have two tables
Table 1: accessorie
+---------------------------+
| id | name |
+---------------------------+
| All the values |
+---------------------------+
Table 2: association
+---------------------------+
| id | id1 | id2 |
+---------------------------+
| All the values |
+---------------------------+
[Table1 columns: id, name]
[Table2 columns: id, id1, id2]
id (in both tables), id1, and id2 are all integers.
Is there any way to filter the result of table1 by one of the columns of table two?
Something like this:
SELECT FROM accessorie WHERE (id = id1 inside the association table)
and
SELECT FROM accessorie WHERE (id != id1 inside the association table)
Thank you for your time
~Gabor