Answer the question
In order to leave comments, you need to log in
How to generate an SQL query?
Hello, there are 2 tables
1) product
2) prod_to_cat
How to form a query to get something like this? Given that the product_id is taken from the first table
Answer the question
In order to leave comments, you need to log in
SELECT
`product_id`
GROUP_CONCAT(`category_id`) AS 'categories'
FROM `prod_to_cat`
GROUP BY product_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question