0
id list
1 {759-10,1147-7,931-10}
2 {719-10,117-2}

expected

id list1 list2
1 759-10 931-10
2 719-10 117-2
1
  • What are you trying to do ? What is the logic behind this expected result ? What have you tried ? Commented Jun 11, 2021 at 10:53

1 Answer 1

1

If you just want the first and last elements, use array operations:

select id, list[1], list[cardinality(list)]
from t;

Here is a db<>fiddle.

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.