Hey guys,
This should be simple, but it is not making sense to me.
I have two tables:
Table A
_______
user id trans cd permission
1080 PRAK C
1080 PR01 null
1080 PR02 A
Table B
_______
user id tran cd permission
1030 PRAK C
1030 PRAG null
1030 PR02 D
I want to create a query that will do the following:
Return records from both tables where the permissions match for the same trans cd.
Return records from both tables where the permissions do not match.
I'm drawing a blank on how to approach this. My query so far:
It does return the trans codes that exist in both tables, but from those results, I need only records with the same permission flags and vice versa. Can anyone help? Total noob here.
This should be simple, but it is not making sense to me.
I have two tables:
Table A
_______
user id trans cd permission
1080 PRAK C
1080 PR01 null
1080 PR02 A
Table B
_______
user id tran cd permission
1030 PRAK C
1030 PRAG null
1030 PR02 D
I want to create a query that will do the following:
Return records from both tables where the permissions match for the same trans cd.
Return records from both tables where the permissions do not match.
I'm drawing a blank on how to approach this. My query so far:
Code:
SELECT A.*, B.*
FROM dbo.morris A,
dbo.abbi B
WHERE A.USER_TRAN_CD=B.USER_TRAN_CD
It does return the trans codes that exist in both tables, but from those results, I need only records with the same permission flags and vice versa. Can anyone help? Total noob here.