Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgresql concatenate multiple rows in group by

SELECT col_a,
array_to_string(array_agg(distinct col_b),',') AS Actor
FROM Table1
GROUP BY col_a;

-- Result:
-- MOVIE	ACTOR
-- A		1,2,3
-- B		4
Comment

PREVIOUS NEXT
Code Example
Sql :: postgres alter table add primary key 
Sql :: rror: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client 
Sql :: postgres DROP and create contraint 
Sql :: su: Authentication failure mysql 
Sql :: postgresql convert text to float 
Sql :: postgres select from last 3 months 
Sql :: sql server alter column 
Sql :: mysql increment value by 1 in update 
Sql :: ora-01950 no privileges on tablespace 
Sql :: postgres connection string 
Sql :: mysql import sql file 
Sql :: search column name sql 
Sql :: oracle drop chain step 
Sql :: oracle reset sequence 
Sql :: mysql delete last row 
Sql :: mysql get first 2 characters of string 
Sql :: mysql strict_trans_tables 
Sql :: mysql add column default value 
Sql :: oracle current timestamp 
Sql :: query any digits record 
Sql :: oracle list data files 
Sql :: hibernate with springboot mysql 
Sql :: mysql show charset 
Sql :: sql server list user permissions 
Sql :: oracle apex who is connected 
Sql :: mysql copy table1 to table2 
Sql :: sql select contem uma palavra 
Sql :: how to delete table in mysql 
Sql :: mysql reset auto increment id 
Sql :: select tables with name like mysql 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =