right outer join
, left outer join
, case
dan juga not exists
juga dapat dimanfaatkan. Beberapa contoh di bawah... (dengan tautan ke contoh kerja SQL Fiddle).
Hubungan luar kanan ke tabel sementara (pilih # UNION)
SELECT GROUP_CONCAT(CASE WHEN COLUMN1 IS NULL THEN "NULL" ELSE COLUMN1 END)
FROM archive
RIGHT OUTER JOIN
(SELECT 21 AS id
UNION SELECT 22 AS id) AS tmp ON tmp.id=archive.column2;
SQL Fiddle:http://sqlfiddle.com/#!2/805e1c/9
Hubungan luar kanan ke tabel ke-2
SELECT GROUP_CONCAT(
CASE WHEN COLUMN1 IS NULL THEN "NULL" ELSE COLUMN1 END)
FROM archive
RIGHT OUTER JOIN temporary tmp ON tmp.id=archive.column2;
SQLFiddle:http://sqlfiddle.com/#!2/36fba/2