1. Коммутаторы нельзя бесконечно цеплять один за другим гирляндой. Максимум два один за другим.Откуда такое ограничение? У меня сейчас, например, между сервером и клиентом находится 5 коммутаторов и всё работает.
WITH RECURSIVE `cte` AS (
SELECT `d`.`ID`, `d`.`ID` AS `root_id`
FROM `departments` AS `d`
UNION
SELECT `d`.`ID`, `cte`.`root_id`
FROM `cte`
JOIN `departments` as `d` ON `d`.`ParentDepartmentID` = `cte`.`ID`
)
SELECT `root_id`, COUNT(*)
FROM `cte`
JOIN `employees` AS `e` ON `e`.`DepartmentID` = `cte`.`ID`
GROUP BY `cte`.`root_id`
SELECT d.*
FROM nodes AS n
JOIN nodes AS c ON c.id >= n.left AND c.id <= n.right
JOIN documents AS d ON d.nodeId = c.id
WHERE n.id = :nodeId
AND условие по параметрам
SELECT *
FROM documents
WHERE nodepPath LIKE CONCAT(:nodePath, '%')
AND условие по документам
$_POST
An associative array of variables passed to the current script via the HTTP POST method when using application/x-www-form-urlencoded or multipart/form-data as the HTTP Content-Type in the request.
-JOIN Attr a ON a.attr_id = js.`child`;
+JOIN Attr a ON a.id = js.`child`;
SELECT `table1`.*, `table2`.*
FROM `table1`
JOIN JSON_TABLE(`table1`.`json`, '$.*' COLUMNS(`child` INT PATH '$')) AS `tt`
JOIN `table2` ON `table2`.`id` = `tt`.`child`