Questions tagged [group-concat]

a function which returns a string representation of the concatenated, non-NULL values of a group

GROUP_CONCAT() or group_concat() is a function which returns a string representation of the concatenated, non-NULL values of a group.

This function is available in a variety of relational databases, including MySQL, SQLite, and MariaDB.

Resources

Related Tags

1334 questions
-1
votes
1 answer

MYSQL query with GROUP_CONCAT option

I have a problem getting proper result from tables. I have 3 tables: Table: Articles |article_id | article_title | |1 | Title 1 | |2 | Title 2 | Table: Invited_to_read |user_id …
Aljosa
  • 1
  • 1
-1
votes
1 answer

Cannot get Ajax to update MySQL row results grouped by GROUP CONCAT. Is it even possible?

I managed to get Ajax to dynamically update MySQL row results by clicking on the entry I want to update and this works. However, if I use GROUP CONCAT I can still click on the entry I want to update but the changes don't get saved. Is this normal?…
PAPADOC
  • 45
  • 1
  • 6
-1
votes
1 answer

ORDER BY within GROUP_CONCAT and GROUP BY with a joined table

Scenario: I have three tables. One table for supplier, another for categories and the last one is a indexer table. Every supplier can choose multiple categories that will be registered in the indexer table. The field parent_id on indexer_table is to…
Corcunda
  • 35
  • 1
  • 6
-1
votes
1 answer

An Issue with merging columns based on the row ID in SQL

I need to merge the comment columns based on the row with the column name ID I had a SQL query in order to merge replies to the commented posts considering count values to the replied posts i.e, comment_counts. I require to display nested comments…
Nɪsʜᴀɴᴛʜ ॐ
  • 2,756
  • 4
  • 33
  • 57
-1
votes
1 answer

Android SQLite grop_concat multiple column

i am trying to run the following query in android. when i try to retrieve the value of the of column 'd' it return null. i can get a.* values though. :( query: select a.*,group_concat(b._id || ', ' || b.product_id || ', ' || b.no_of_units || ', '…
-1
votes
2 answers

PHP & MYSQL - Display user-uploaded photos from Database according to date photos were uploaded

I created photo upload form. Different users are able to upload multiple photos at once and the photos, the user's details and input get stored in the database as shown in picture below: I want to be able to display the users and their photos in my…
Elizabeth Kof
  • 65
  • 1
  • 2
  • 8
-1
votes
1 answer

How to separate group_concat result in multiple rows using MySQL?

My table is as below: create table testing( bnum varchar(7) ); and here is the values: insert into testing…
Tareq
  • 1,999
  • 2
  • 28
  • 57
-1
votes
1 answer

MYSQL Complex Join one-to-many

I have the following tables: clients: | id | name | code | zone | -------------------------------- | 1 | client 1 | a1b1 | zone1| | 2 | client 2 | a2b2 | zone2| contacts: | id_contact | first_name | last_name…
billssam
  • 1
  • 1
-1
votes
1 answer

GROUP_CONCAT limiting to 100 values is not working

I am trying to extract a sum of modified history field limited by 100 and grouped by each account, but the query below extracts sum of all rows from CDR_Accounts with charged_quantity = 60 and does not limit to 100. table1 = table2 and these are the…
Vadym
  • 1
  • 4
-1
votes
1 answer

how to sql distinct value inside a column that have multiple string delimeter by ','

enter image description here hello everyone , i'm trying to generate new table using mysql that have difference value (which means eliminating duplicate) in the same column that have so much of string. I already try group_concat(distinct column_name…
Lejiend
  • 1,219
  • 2
  • 16
  • 24
-1
votes
1 answer

create an additional column with select union in Mysql

I have 2 tables: table1 and table2, both tables have structure as ; id - day - uniques - pageviews. I want to create an additional field containing uniques values in format like 2387|1283 while at the same time summing up uniques and pageviews for…
burkul
  • 113
  • 1
  • 5
-1
votes
3 answers

Mysql Union Left Join Group Concat

I need help with this Mysql query Select id, code, Tbldetail from TblProd The result is: id code detail (i Need ADD Model Column Here) 100 432320-1 Keyboard 101 432325-1 Mouse 102 432329-1 …
Peter013
  • 69
  • 4
-1
votes
1 answer

Compare two strings using MYSQL

I have two strings in comma separated. String1='ABC,DEF,PQR,MNO,XYZ' String2='PQR,FGH' String3='GHI,JKL,TUV' Now I want that, compare string1 and string2, it will return true because String2 has value 'PQR' that matches with String1. But…
Khushal
  • 166
  • 1
  • 3
  • 16
-1
votes
1 answer

GROUP_CONCAT: search for subset and retrieve all values

I have this two tables: posts +--------------------------------------------------------------------+ |id ¦status¦type ¦url …
fusion3k
  • 11,568
  • 4
  • 25
  • 47
-1
votes
1 answer

Why are HAVING and GROUP_CONCAT not working together in this query?

This query: SELECT name, REPLACE(REPLACE(REPLACE(LOWER(name),' ',''),'-',''),':','') AS formattedName, GROUP_CONCAT(service) FROM movies GROUP BY formattedName HAVING COUNT(CASE WHEN name like "%von brom%" THEN 1 END) > 0; Gives me the…
Istlemin
  • 131
  • 2
  • 11