I have a select statement with rows as table_Schema I need to merge the rows such that blogs with same row id are merged into a single row. I am trying to get either <author fname, author mname, author lname | coauthor fname coauthor lname> or a column as author co author Each blog can have multiple authors and co
Tag: group-concat
MYSQL Select different records from same table
I am working on small school database and I need some help with selecting students that are only booked on different days in week 1 and week 2. My table structure is like below: I would like to get all the children that meet the following criteria: ONLY booked in week two (This is ChildId 2 and I can get
SQL Function inside of where clause to see if field is in concatenated list (from parameter)
I have these two lines ,SUM (CASE WHEN (DATEDIFF(DAY,Shopify_Ordered,Confirmed) >= 1)THEN 1 ELSE 0 END) OVER () Orders1DayNotShipped ,dbo.GROUP_CONCAT( (CASE WHEN (DATEDIFF(DAY,Shopify_Ordered,…
mysql – GROUP_CONCAT rows into a string
I have a following result set: req_id | p_id | ai_result | hash | sku 1 | 4 | Match | XAN | HOW 1 | 4 | Match | HXN | HOW 1 | 4 | Non Match | 123 | …
Multiple COALESCE in GROUP_CONCAT – is showing value if only first column isn’t null
Two table’s purchase and sales ‘s column date column has been concatenated as date row. GROUP_CONCAT(purchase.date,’,’,sales.date) AS date But both of them can be blank, according to data input. So …
Optimize GROUP_CONCAT in SQL on MySQL
Is there a way to get the following SQL optimized so it would run faster? I encountered the bottleneck are the GROUP_CONCAT’s but I couldn’t find a way by using an alternative or optimizing the query so it would run faster. At the moment the query needs about 3.2s on 2700 entries (mysql database 5.1.73, mysqli). All tables have indices
Using COUNT in GROUP_CONCAT
This is my table: id | fk_company ——————- 1 | 2 2 | 2 3 | 2 4 | 4 5 | 4 6 | 11 7 | 11 8 | 11 …
Join one row to multiple rows in another table
I have a table to entities (lets call them people) and properties (one person can have an arbitrary number of properties). Ex: People Properties I would like to write an efficient select that would select people based on age and return all or some of their properties. It’s also acceptable to return one of the properties and total property count.