0

I have record like this:

TM67 | 4 | 32556
TM67 | 9 | 98200
TM67 | 72 | 22300
TM99 | 2 | 23009
TM99 | 3 | 11200

and I'm aiming for grouped results like:

TM67 | 32556-4, 98200-9, 22300-72
TM99 | 2-23009, 3-11200

is it even possible??

Lukas Novicky
  • 921
  • 1
  • 19
  • 44
  • it's not the same question, but very simmilar. Besides - found solution: STRING_AGG( CONCAT(field1, '-',field2), ';') – Lukas Novicky May 14 '15 at 12:19
  • No, it's really the same question. You just need an expression as the argument instead of a single column. `string_agg` is covered in the [second answer](http://stackoverflow.com/a/8803563/1394393) there. It's appropriate to close as a dupe. Also, concatenation is usually done using `||`, I believe. So `STRING_AGG(field1||'-'||field2, ';')`. – jpmc26 May 14 '15 at 13:02

0 Answers0