-1

Is it possible to group SQL rows with the same column value into one row?

Simple table to demonstrate what I mean

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
Ryan
  • 1

1 Answers1

0

For Postgresql string_agg For Mysql use GROUP_CONCAT Please try i.e mysql

SELECT 
    ID,
    GROUP_CONCAT(CONCAT_WS( ':', title, Number )
SEPARATOR ',' ) AS Title
FROM
    example        
GROUP BY ID
Dipti
  • 545
  • 3
  • 12