On 1/27/2014, 9:57 AM, Jean-Christophe Deschamps wrote:
I'm trying to find the correct syntaxt for this, but I hit a syntax error each
time: either SQLite shokes on outer parenthesis or on union all.

Try something like this, which is a minimal change from yours:

(select * from
(select * from A where x in (subselectA)) dx
left outer join
(select * from B where y in (subselectB)) dy using (...)
)
union all
(select * from
(select * from B where y in (subselectC)) dx
left outer join
(select * from A where x in (subselectD)) dy using (...)
)

... but replace the "using (...)" with a join condition saying which fields you want to be used for matching in the join, and also replace the "select *" with a specific list of fields you want to match up for the union.

-- Darren Duncan

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to