(
(select * from trees as laravel_reserved_0 where laravel_reserved_0.link = tr.link)
union all (select trees.* from trees inner join laravel_cte on laravel_cte.link = trees.parent_link)
)
select count(*) from goods where goods.parent_link in (select link from laravel_cte)) as recursive_goods_count from trees as tr
where tr.parent_link = 00000000-0000-0000-0000-000000000000;
Ошибка [42S22][1054] Unknown column 'tr.link' in 'where clause'
Как то можно переписать запрос так, что бы он заработал в mariaDB 10.4?
https://mariadb.com/kb/en/with/
Обсуждают сегодня