我有2個表:從一個表使用的信息以便發現信息在另一個表中存在
廣告:
+------+---------------+
| ID | Name |
+------+---------------+
| 1 | Item 1 |
| 2 | Item 2 |
| 3 | Item 3 |
| 4 | Item 4 |
| 5 | Item 5 |
+------+---------------+
assigned_ads:
+------+-----------+--------------+
| ID | ad_id | location |
+------+-----------+--------------+
| 1 | 3 | place 1 |
| 2 | 2 | place 2 |
| 3 | 1 | place 3 |
+------+-----------+--------------+
正如你所看到的; ad 1,2和3都被分配到一個位置。我需要的是一個查詢,獲取未在assigned_ads
表分配ads
表中的所有行
[從另一個表(JOIN)獲取非現有數據的可能的重複](http://stackoverflow.com/questions/7494586/get-non-existing-disting-from-another-table-join) – onedaywhen