Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT LEFT(COLUMN_NAME, LENGTH(COLUMN_NAME) - 1)
- FROM (
- SELECT COLUMN_NAME + ', '
- FROM information_schema.columns
- WHERE table_name IN ('Employee')
- FOR XML PATH ('')
- ) c (COLUMN_NAME)
- $ ./install testdb
- CREATE AGGREGATE
- Created uda
- Done
- CREATE AGGREGATE
- Created uda
- Done
- TESTDB.ADMIN(ADMIN)=> select * from test_gc order by col1, col2;
- COL1 | COL2
- ------+------
- 1 | A
- 1 | B
- 1 | C
- 2 | C
- 2 | D
- 2 | E
- (6 rows)
- TESTDB.ADMIN(ADMIN)=> select col1, group_concat(col2,',') from test_gc group by col1 order by col1;
- COL1 | GROUP_CONCAT
- ------+--------------
- 1 | A,B,C
- 2 | C,D,E
- (2 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement