GROUP_CONCAT bringing incomplete response

Asked

Viewed 130 times

0

I am trying to bring all the product names (even the repeated ones) I have registered in a spreadsheet, but the code is stopping in the middle of the process. Can anyone tell me why ? Is there a character limit that when hit on GROUP_CONCAT query is aborted ?

I’m adding a '\n' so that in the string each name end has a line break.

my db is relational so I need to make a path until I get the Description item. Below:

SELECT GROUP_CONCAT(desc.nome_produto separator '\n')
FROM
  tb_cadastro_itens itens
INNER JOIN 
  tb_cadastro_raiz root
ON 
  root.id = itens.id_item_cadastro
INNER JOIN 
  subtb_cadastro_descricao desc
ON
  desc.id = root.id_desc
WHERE itens.prateleira = 3
  • try to change to this (desc.nome_produto, '\n');

  • @Matthew strange guy, this way changes the result a little but is still far from the correct end of the result. I believe it is something amount of characters because no matter the condition I put the result to around 900 characters.

  • the result to even in the middle of a word leaving it incomplete, for example: what would be 'HAMMER' for at the 'MART'

  • Take a look at the LIMIT SQL . And see if there’s anything wrong with your WHERE?

  • I managed to solve the problem, really it is a problem of GROUP_CONCAT() Maximum length, I managed to solve it by doing a SET like this: SET SESSION group_concat_max_len = 1000000 ... however it is a temporary solution that will have to be replayed every time you call a large GROUP_CONCAT. Anyway thanks for the help @Matthew

  • I get it. You’re welcome.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.