Possible Duplicate:
MySQL - How to get a list of values in Table A that don’t exist in Table B?
I have three tables .
Table x:
+------+
| ID |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
+------+
Table Y
+------+
| ID |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
+------+
Table Z
+------+
| ID |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
+------+
I have to find the value exists in TABLE Z
but it not exists in table X and Y
.
Output:
+----+
| ID |
------
| 6 |
| 7 |
+----+
How can I get this?