Answer the question
In order to leave comments, you need to log in
How to use GROUP BY to store the ID of the records that were grouped?
Here is an example of code that I am trying to implement, but it does not work.
SELECT *,
id_category AS (
SELECT id FROM bot_shop_category
WHERE name = a.name
)
FROM bot_shop_category a
GROUP BY name
0 => [ name : "Название сгруппированых категорий", id_category : {1,5,97,22, ...} ]
1 => [ name : "Название сгруппированых категорий 2", id_category : {13,52,971,224, ...} ]
... и.т.д
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question