Join Rows
To combine matching rows in multiple tables, use a join
SELECT nm.id ANSWER ,jb.job ID NAME JOB FROM emp_nm nm ,emp_jb jb 10 Sanders Sales WHERE nm.id = jb.id 20 Pernal Clerk ORDER BY 1;
Outer Join
To get all of the rows from one table, plus the matching rows from another table (if there are
any), use an outer join
SELECT nm.id ANSWER,nm.name ,jb.job ID NAME JOB FROM emp_nm nm LEFT OUTER JOIN 10 Sanders Sales emp_jb jb ON nm.id = jb.id ORDER BY nm.id; Fetch First "n" Rows
To fetch the first "n" matching rows, use the FETCH FIRST notation
SELECT * FROM EMP_MM ORDER BY ID DESC FETCH FIRST 2 ROWS ONLY