Hallo zusammen,
Warum funktioniert "UNION" nicht ? Es kommt immer ungültiges Schlüsselwort UNION als Fehler!!!
Delphi-Quellcode:
with tq.SQL do
begin
Clear;
Text:='SELECT * FROM '+#39+tab_1+#39' AS SRC LEFT JOIN'+
#39+tab_2+#39+' AS DST'#10+
'ON (SRC.ID=DST.ID)'+#10+
'ORDER BY Name'+#10+
'UNION'+#10+
'SELECT * FROM '+#39+tab_1+#39' AS SRC RIGHT JOIN'+
#39+tab_2+#39+' AS DST'#10+
'ON (SRC.ID<>DST.ID)'+#10+
'ORDER BY Name';
end;
tq.Open;
Danke