Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT (lastname || ', ' || firstname) as fullname
- FROM users
- WHERE {some condition}
- -- result --
- fullname
- Anderson, Alex
- Baker, Bob
- Clark, Carl
- SELECT LISTAGG(fullname, '; ') WITHIN GROUP (ORDER BY fullname) as instructors
- FROM
- (
- SELECT (lastname || ', ' || firstname) as fullname
- FROM users
- WHERE {some condition}
- )
- -- desired result --
- instructors
- Anderson, Alex; Baker, Bob; Clark, Carl
- -- actual result --
- Error Type: System.Xml.XmlException
- Error Message: hexadecimal value 0x00, is an invalid character. Line 1, position 32.
- SELECT LISTAGG(fullname, '; ') WITHIN GROUP (ORDER BY fullname) as instructors
- FROM
- (
- SELECT (pk1 || ', ' || pk1) as fullname -- pk1 is the users primary key
- FROM users
- WHERE {some condition}
- )
- -- result --
- instructors
- 01, 01; 02, 02; 03, 03
Add Comment
Please, Sign In to add comment