I'm trying to write a SQL query that will give me the records of those who have two different tax codes. Here is my query:
select eid, tax_code from tax_table where tax_status='?' group by eid, tax_code order by eid
For simplicity purposes, this is an example of a record that this query produced:
Employee ID Tax Code
00027 KS
00027 MO
Is there a way for SQL to determine for each employee ID if they have more than one Tax code? I've tried doing a count on Tax Code but its given me errors. Please help! Thank you.
The ? is not part of the actual query.
select eid, tax_code from tax_table where tax_status='?' group by eid, tax_code order by eid
For simplicity purposes, this is an example of a record that this query produced:
Employee ID Tax Code
00027 KS
00027 MO
Is there a way for SQL to determine for each employee ID if they have more than one Tax code? I've tried doing a count on Tax Code but its given me errors. Please help! Thank you.
The ? is not part of the actual query.