Answer the question
In order to leave comments, you need to log in
Where is the best place to place a query with the output of the nth number of rows?
There is such a request that displays information about the orders of a certain manager, as well as files attached to this order.
SELECT orders_design.id_order_design, clients.name, orders_design.id_order_print, orders_design.type_product,
orders_design.parameters, orders_design.date_order FROM orders_design INNER JOIN clients ON orders_design.id_client =
clients.id_client WHERE clients.id_manager = '1' AND files.name IN ( SELECT name FROM files WHERE id_order_design =
orders_design.id_order_design)
Answer the question
In order to leave comments, you need to log in
Your request still does not display file names.
SELECT `od`.`id_order_design`, `c`.`name`, `od`.`id_order_print`,
`od`.`type_product`, `od`.`parameters`, `od`.`date_order`,
`f`.`filelist`
FROM `orders_design` AS `od`
JOIN `clients` AS `c` ON `od`.`id_client` = `c`.`id_client`
LEFT JOIN (
SELECT `id_order_design`, GROUP_CONCAT(`name` SEPARATOR '|') AS `filelist`
FROM `files`
GROUP BY `id_order_design`
) AS `f` ON `f`.`id_order_design` = `od`.`id_order_design`
WHERE `c`.`id_manager` = 1
something is not a request, but some kind of heresy, you know that it will not be executed?
I think while you debug the request, then the solution will come by itself ... separate the flies from the cutlets
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question