SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table t ( "name" varchar(64), "location" varchar(64), "team_id" int, "start" int, "end" int ); insert into t values ( 'Library', 'Atlanta', 2389, 2015, 2017 ), ( 'Library', 'Georgetown', 9920, 2003, 2007 ), ( 'Museum', 'Auckland', 3092, 2005, 2007 ); select name, string_agg( concat(location, ', ', team_id, ', ', start, '-', "end"), E'\n') AS records FROM t group by name;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear