Reputation: 306
I'm try to create a report on Teradata security (DBC.ALLRIGHTS). When a user has more than one permission, I would like to group those into one row.
These rows:
Would be combined like this:
Upvotes: 0
Views: 35
Reputation: 8693
You can use XMLAgg for this:
select databasename, tablename, username, TRIM(TRAILING ',' FROM (XMLAGG(TRIM(AccessRight)|| ',' ORDER BY AccessRight) (VARCHAR(10000)))) from dbc.allrights group by 1,2,3
Upvotes: 2