Einzelnen Beitrag anzeigen

Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.021 Beiträge
 
Delphi 12 Athens
 
#2

AW: Interbase: Merkwürdiges Verhalten bei LEFT OUTER JOIN

  Alt 7. Apr 2020, 17:08
Das Verhalten finde ich zumindest auch merkwürdig. SQL-Server liefert das erwartete Ergebnis. Interbase 2020 kann ich auch nur mit dieser Version das erwünschte Ergebnis entlocken:
SQL-Code:
select t1.id as id1, t2.id as id2, t3.id as id3 from
  test t1
  left outer join test t2 on t2.id = t1.id and t2.id = 1
  left outer join test t3 on t3.id = t1.id and t3.id = 1;

select t1.id as id1, t2.id as id2, t3.id as id3 from
  test t1
  left outer join test t2 on t2.id = t1.id and t2.id = 0
  left outer join test t3 on t3.id = t1.id and t3.id = 0;

select t1.id as id1, t2.id as id2, t3.id as id3 from
  test t1
  left outer join test t2 on t2.id = t1.id and t2.id = 1
  left outer join test t3 on t3.id = t1.id and t3.id = 0;

select t1.id as id1, t2.id as id2, t3.id as id3 from
  test t1
  left outer join test t2 on t2.id = t1.id and t2.id = 0
  left outer join test t3 on t3.id = t1.id and t3.id = 1;
Ich finde, das sollte zumindest mal im QP gemeldet werden.
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat