Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.184 Beiträge
Delphi 12 Athens
|
AW: verschachtelte Query
22. Apr 2020, 00: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;
$2B or not $2B
Geändert von himitsu (22. Apr 2020 um 00:23 Uhr)
|