tags:

views:

96

answers:

1

sqlite only have INNER and LEFT JOIN.

Is there a way to do a FULL OUTER JOIN with sqlite?

+5  A: 

Yes, see the example on Wikipedia.

SELECT employee.*, department.*
FROM   employee 
       LEFT JOIN department 
          ON employee.DepartmentID = department.DepartmentID
UNION ALL
SELECT employee.*, department.*
FROM   department
       LEFT JOIN employee
          ON employee.DepartmentID = department.DepartmentID
WHERE  employee.DepartmentID IS NULL
Mark Byers