I'm still trying to use my limited knowledge of MySQL to help out a team at work, as in my last question.
The Warehouse table has a foreign key called nearest, which relates to another WarehouseID. What query generates a list of Warehouse records that are not referenced in any other Warehouse foreign key?
So running the query on:
ID NEAREST
1 3
2 3
3 2
4 NULL
Would return:
ID
1
4
That might not seem a very useful query, but I've been trying to learn LEFT OUTER JOINs (which I'm fairly sure I need) and if I can manage this query I can easily apply it to the other tasks that are a bit harder for me to explain here.
I hope this is clear!