0

How I start coding to get below output.

id Column1
1 A1
2 A2
3 A1
4 A2
5 A1
6 A1

output should be below.

id Column1 Column1.1 Column1.2
1 A1 A1
2 A2 A2
3 A1 A1
4 A2 A2
5 A1 A1
6 A1 A1
1
  • What is the logic behind your result Commented Jun 20, 2022 at 14:24

1 Answer 1

1

We can try to use CASE WHEN expression to make it.

SELECT id,
       Column1,
       CASE WHEN Column1 = 'A1' THEN Column1 END 'Column1.1',
       CASE WHEN Column1 = 'A2' THEN Column1 END 'Column1.2'
FROM T
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.