The following example illustrates a left outer join. See Outer Joins. In the example, the skills table lists various skills and the associated codes, and the emp table lists employee numbers and a skills codes.
You can use this query to determine which skill areas do not have assigned employees:
SELECT skills.skill_name, emp.emp_no FROM skills LEFT OUTER JOIN emp ON skills.skill_no=emp.skill_no;
The following result is returned. Notice that nulls are displayed as a QUESTION MARK (?) character, which is how BTEQ reports nulls. For more information about BTEQ, see Basic Teradata® Query Reference, B035-2414.
To include all skills in the result, you must specify an OUTER JOIN. An implicit join like this example that uses just the simple FROM clause does not return rows for nulls (that is, when there are no corresponding employees) and would not list doctor or tailor in the above result.
… FROM employee, skills …