我有三个表(管理员、域、用户),如下所示
- 'admin'(admin_id, email, domain_id, pass)
- '域'(domain_id,名称)
- 'user' (user_id, email, domain_id, pass)
管理员表:
+--------------------------------+
| admin_id | email | domain_id |
+--------------------------------+
| 1 | aaa | 2034 |
| 2 | bbb | 3034 |
| 3 | ccc | 2034 |
+--------------------------------+
用户表
+--------------------------------+
| user_id | email | domain_id |
+--------------------------------+
| 11 | aaa | 2034 |
| 12 | bbb | 3034 |
| 13 | ccc | 2034 |
| 15 | ddd | 2034 |
| 16 | eee | 3034 |
+--------------------------------+
域表:
+-----------------------+
| domain_id | name |
+-----------------------+
| 2034 | aaa.com |
| 3034 | bbb.com |
+-----------------------+
输出:
+------------+
|ddd@aaa.com |
|eee@bbb.com |
+------------+
所以我想要用户表中不存在于管理表中的记录。
如果没有 NOT IN 查询,有什么办法吗?