I have two tables which look like this:
T1: T1ID | Date | Time | Barcode
T2: T2ID | Date | Time | Barcode
I basically want to reconcile each record and return T1ID and T2ID so that I know that T1 entry match with T2ID.
Result should be like this:
T1ID | T2ID | Date | Time | Barcode
I have done the reconcile bit but I don’t have any idea abt how do I get T1ID and T2ID in row.
Reconcile Query is below.
SELECT Date,Time,Barcode
FROM
( Select Date ,Time ,Barcode from T1
union All
Select Date, Time , Barcode from T2 ) as Reconcile
GROUP BY Date ,Time ,Barcode
Having count(Date) > 1 ;
Can anyone point me on the right track?
I don’t think you are looking for a “UNION ALL”. It looks more like a JOIN to me.
Something like this: