I am trying to compile a list of "None Sellers", I am getting a list of distinct seller_id's and comparing that to the "list of sellers" aka account_manager_sellers
using the NOT IN clause, but this is not working for me.
Table plans
:
+----+-----------+
| id | seller_id |
+----+-----------+
| 1 | 1001 |
| 2 | 1002 |
| 3 | 1002 |
| 4 | 1001 |
| 5 | 1005 |
+----+-----------+
Table account_manager_sellers
:
+------+--------------+
| id | persons_name |
+------+--------------+
| 1001 | name_1 |
| 1002 | name_2 |
| 1003 | name_3 |
| 1004 | name_4 |
| 1005 | name_5 |
+------+--------------+
Expected Result:
+------+--------------+
| id | persons_name |
+------+--------------+
| 1003 | name_3 |
| 1004 | name_4 |
+------+--------------+
SELECT DISTINCT(p.seller_id) FROM plans p
WHERE p.seller_id NOT IN (
SELECT a.id FROM account_manager_sellers a
)
This snippet is running but not returning any results.