Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
So I have two tables A & B.
I first need to load Table A and retrieve ALL of field DTNUM according to the below criteria.
Table A | |
DTNUM | Cannot equal 0 |
PLWRK |
must equal '0600', '0602', '5440', '5442', '4980', '3930', '544E' |
Now for all the retrieved rows I need to get data from Table B according to below criteria. Only Where the DTNUM field from Table A matches the DTNUM field in Table B
Table B | |
DTNUM | |
PLUMI | Cannot equal 'B' |
There are far more fields I need to include but have slimmed down for simplicity
[Table A]:
LOAD
PLWRK,
DTNUM
where not match (DTNUM,'0000000000');
[Table A]:
SELECT
PLWRK,
DTNUM,
FROM "X"
WHERE "PLWRK" IN ('0600', '0602', '5440', '5442', '4980', '3930', '544E')
;
Table B:
LIB CONNECT TO [X];
Left Join ([Table A])
LOAD
DTNUM,
PLUMI,
WHERE NOT MATCH (PLUMI, 'B');
[Table B]:
SELECT
DTNUM,
PLUMI,
FROM "X"
;
When I run the above it will cause no errors but the rows retrieved do not match the criteria.
Any Assistance Is greatly received
TIA
Hello,
Have you tried inner join instead of left join?