I have two tables: User table and Order table
Let say user table has following records
Order table has following two records
As you see there are two user accounts for each emaila and emailc
However usera2 using emaila is just duplicate account with no associated record in order table.
How can I get SQL query that will give me list of such duplicate accounts?
Please note userd is not in the order table but there us no duplicate in the user table so it should not be included in query result.
Basically query should result user account that is not in order table and that has another account using same email.