Einzelnen Beitrag anzeigen

Blup

Registriert seit: 7. Aug 2008
Ort: Brandenburg
1.429 Beiträge
 
Delphi 10.4 Sydney
 
#3

AW: SQL Vereinfachen

  Alt 16. Feb 2012, 16:48
Ungetestet im Prinzip so:
SQL-Code:
select distinct a.nr, a.name
from beh a
left join qundz b on (b.ziel = a.nr)
left join beh c on (c.nr = b.quelle) and (c.rohstoff = :rohstoff1)
left join beh d on (d.nr = b.quelle) and (d.rohstoff = :rohstoff2)
left join beh e on (e.nr = b.quelle) and (e.rohstoff = :rohstoff3)
where (c.nr is not null) and (d.nr is not null) and (e.nr is not null)

Geändert von mkinzler (16. Feb 2012 um 16:50 Uhr) Grund: Tag für SQL ergänzt
  Mit Zitat antworten Zitat