Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.360 Beiträge
Delphi 12 Athens
|
AW: verschachtelte Query
21. Apr 2020, 23:20
https://stackoverflow.com/questions/...ecursive-query
SQL-Code:
with recursive temptablename (id, name, parent_id) as (
select id, name, parent_id
from products
where parent_id = 19 -- Initialisierung
union all
select p.id, p.name, p.parent_id
from products p
inner join temptablename
on p.parent_id = temptablename.id -- Rekursion
)
select * from temptablename;
Ein Therapeut entspricht 1024 Gigapeut.
Geändert von himitsu (21. Apr 2020 um 23:23 Uhr)
|