I have a table that a set of data from 2 sources. The difference is the employeeid has letters in the front when coming from table b:
employee id [Pay Group ID]
WD506197 US01
506197 USA-1
Below is the code I have so far, but I am not sure how to distinguish the tables and if this is going to work:
Select
a.[employee id], a.[Pay Group ID],
'Analysis' = Case when a.[Pay Group ID] = b.[Pay Group ID] then ''
when a.[Pay Group ID] <> b.[Pay Group ID]
then 'MisMatch' end
from whse_AssignEmployeetoPayGroup a
inner join whse_AssignEmployeetoPayGroup b on b.[employee id] = a.[employee id]
I want something like this as the results:
employee id [Pay Group ID]
WD506197 'MisMatch'
Any help is greatly appreciated!
employee id [Pay Group ID]
WD506197 US01
506197 USA-1
Below is the code I have so far, but I am not sure how to distinguish the tables and if this is going to work:
Select
a.[employee id], a.[Pay Group ID],
'Analysis' = Case when a.[Pay Group ID] = b.[Pay Group ID] then ''
when a.[Pay Group ID] <> b.[Pay Group ID]
then 'MisMatch' end
from whse_AssignEmployeetoPayGroup a
inner join whse_AssignEmployeetoPayGroup b on b.[employee id] = a.[employee id]
I want something like this as the results:
employee id [Pay Group ID]
WD506197 'MisMatch'
Any help is greatly appreciated!