Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
Delphi 7 Enterprise
|
AW: rekursives select
13. Mär 2011, 17:08
SQL-Code:
with recursive x (id, ref, Anz, Artikel) as
(
select
s.modell, s.referenz, s.anz, m.partnumber
from stueckliste s
join modelle m on m.id = s.referenz
where s.modell = :id
union all
select
s.modell, s.referenz, s.anz, m.partnumber
from stueckliste s
join modelle m on m.id = s.referenz
inner join x on s.modell = x.ref
)
SELECT *
FROM x x1
WHERE NOT EXISTS (SELECT *
FROM x
WHERE id = x1.ref)
|
|
Zitat
|