Questions tagged as 'group-concat'

1
answer

Pass variable value into nested SELECT

Assuming the following query where we are selecting values, grouping them and then re-grouping the result: SELECT CONCAT (b.label, '|', b.slug) FROM ( SELECT group_concat(name SEPARATOR '$') AS label, group_concat(slug...
asked by 09.04.2015 / 18:31
1
answer

group_concat () from MySql on SqlServer

I created a table for example: I have the following content: select * from table_t; Youneedtogetthefollowingresult: In MySql I use the following query: select group_concat(concat_ws(' - ',id,descri)) id_descri, tipo from table_t grou...
asked by 27.04.2015 / 13:57
1
answer

Working with group_concat

I have some questions regarding the use of group_concat , more specifically performance. When using group_concat you can not use limit . // a query retorna todos os ID's select group_concat( id ) from table limit 5 // pelo...
asked by 18.08.2015 / 00:53
1
answer

Group data from a Query?

I do a GROUP BY in a query result and the result comes like this: Iwouldliketoknowifitispossibletobringgroupedinthisway? I'd like to know if this collation is best done in PHP or Query and how can it be done? Follow my code: SQL...
asked by 22.05.2017 / 18:22
1
answer

Repeated data with GROUP_CONCAT

I'm having a problem when I make a SELECT in my DB, I'm using GROUP_CONCAT to concatenate the phone and email column but I'm getting repeated data. Here is SELECT : SELECT contatos.cont_id , contatos.cont_firstname...
asked by 10.06.2016 / 06:23
1
answer

Result SQL statement

Hello! I have a table of a questionnaire, I would like to have a result grouped by "property", doing a GROUP_CONCAT in the "answers", according to the model below: property | question | answers     10 | 1 | rice, beans     10 | 2 | rice, be...
asked by 02.03.2018 / 21:22
1
answer

Concatenate Lines with the same User

I have the following query: SELECT e.id_taxe, u.nm_user, dt_taxe, SUM(e.vl_taxe) as vl_taxe FROM taxe as e INNER JOIN user as u ON u.id_user = e.id_user WHERE id_enterprise = 86 AND (dt_taxe BETWEEN '2017-01-01' AND '2017-03-31') AND lg_can...
asked by 13.03.2017 / 19:11