I\'m trying to join two tables using a left-join. And the result set has to include only the first record from the \"right\" joined table.
Lets say I have two tables
In Oracle you can do:
WITH first_b AS (SELECT code, min(rowid) AS rid FROM b GROUP BY code)) SELECT a.code, a.emp_no, b.city, b.county FROM a INNER JOIN first_b ON first_b.code = a.code INNER JOIN b ON b.rowid = first_b.rid