IBM PureData System for Analytics, Version 7.1

Left outer join/left join

A left outer join selects all the rows from the table on the left (cows_one in the sample), and displays the matching rows from the table on the right (cows_two). It displays an empty row for the table on the right if the table has no matching row for the table on the left.
SELECT * FROM cows_one LEFT OUTER JOIN cows_two ON cows_one.cnumber = 
cows_two.cnumber;
cnumber       | cbreed        |cnumber  | breeds
-----------   +------------+   ---------+---------
1             | Holstein      |         |
2             | Guernsey      | 2       | Jersey
3             | Angus         | 3       | Brown Swiss
(3 rows)

The keyword outer is optional.



Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28