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

postgresql insert multiple rows


        
            
        
     INSERT INTO table_name (column_list)
VALUES
    (value_list_1),
    (value_list_2),
    ...
    (value_list_n);
Comment

PREVIOUS NEXT
Code Example
Sql :: sql insert from excel 
Sql :: sql remove decimal places 
Sql :: t-sql create trigger 
Sql :: sql server convert date to weekday 
Sql :: sp in sql server 
Sql :: add colum date in sql 
Sql :: python sqlite data delete 
Sql :: getdate function in postgresql 
Sql :: postgresql get date now 
Sql :: db.relationship sqlalchemy flask 
Sql :: mysql delete duplicates 
Sql :: mysql decimal allow negative values? 
Sql :: csv into data postgres 
Sql :: SQL UNION ALL Operator 
Sql :: launch sql script from docker in mysql 
Sql :: mysql stored procedure vs function 
Sql :: alter table add check constraint oracle 
Sql :: run mysql command from bash 
Sql :: mysql multiple order by 
Sql :: sql cast 
Sql :: default number in sql 
Sql :: groupby error in mysql 
Sql :: set all auto_increment values in sql 
Sql :: dba_dependencies 
Sql :: mysql count characters in string 
Sql :: sum value by month sql 
Sql :: is sql fast 
Sql :: sqlite3 update select 
Sql :: sql select where clause 
Sql :: sql column name 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =