Should you need rows to return from primary (left) table even when no match exists in other tables you may use the outer join syntax as follows:
SELECT EMPNO, LASTNAME, PROJNO
FROM CORPDATA.EMPLOYEE LEFT OUTER JOIN CORPDATA.PROJECT
ON EMPNO = RESPEMP
This will return all rows from employees even if the employees have no rows in the project table.
Dig Deeper on DB2 UDB (universal databases)
Related Q&A from Shahar Mor
Use work station customize object or printer type in iSeries Access to print the output of an RPG file from the AS/400 to an HP printer. Continue Reading
Connecting the iSeries in AS/400, issue STRHOSTSVR *ALL. Make sure the as-signon port is in listen state and check the firewall settings. Continue Reading
Searching for the right API to add users to an EIM SSO implementation? The IBM site includes sample APIs based on C. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.