I have 2 tables formatted the following ways listed below...
T1
ID SUB_ID NAME NUM
123 ABC TEST 5
456 XYZ HELLO 10
T2
ID SUB_ID NAME NUM CAT ACTY
123 ABC TEST 5 sjq h5h
456 XYZ HELLO 10 hwl 888
I want to look at these 2 tables and match based on ID and SUB_ID and join them together so I get all the columns from T1 and those columns missing from T1 that are in T2
Both these tables contain thousands of rows but I simplified for this example.
This is the code I have tried but I am getting to many rows back..
SELECT *
FROM T1 YY
INNER JOIN T2 ZZ
WHERE YY.ID = ZZ.ID and YY.SUB_ID = ZZ.SUB_ID
Any help on how to execute this would be GREATLY appreciated. THANKS!!