1

i have records

id | key | string column
------------------------
1  | 1   | A
------------------------
1  | 1   | B
------------------------
1  | 1   | C

i want result like below

id | key | string column
------------------------
1  | 1   | A, B, C
------------------------

someone know how to do? thank you

1 Answer 1

1

You are looking for listagg():

select id, key, listagg(string, ', ') within group (order by string)
from t
group by id, key;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.