Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
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 AI support!

Copy Clear