0
I have a table called shops, this table has: ..., store name and loja_category, example:
nome_loja | loja_categoria -------------------------- loja1 | roupas loja2 | brinquedos loja3 | roupas
what I would like to do is group the records with the same category name, case insensitive if possible, with the result being an associative array with the category name, something like this:
roupas => ( loja1, loja3 ), brinquedos => ( loja2 )
tried the
select
withgroup by
by store name?– Ricardo Pontual
Can you give me an example? I used GROUP BY loja_categoria, it only brought a result
– Thiago
what language are you using? I think you can receive from mysql and treat (group) by code, not?!
– rLinhares
I am using PHP if not feasible using SQL...
– Thiago
What you want to do is better do via code same.
– Lucas Brogni
group_concat https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.html#function_group-Concat
– Motta
How would the query, Motta?
– Thiago