I am running this query on phpmyadmin and it gives a syntax error,
Delete from users_roles as ur where ur.uid NOT IN (select u.uid from users as u)
ERROR: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as ur where ur.uid NOT IN (select u.uid from users as u)' at line 1
and when I am running this query
select ur.uid from users_roles as ur where ur.uid NOT IN (select u.uid from users as u)
it gives me the result.