1

I'm working with AWS Redshift and while querying one of my tables I'm getting columns that have only values of null.

C1    C2     C3     C4    C5 
--------------------------------
34    43.5   null   75.4   null
null  43.5   null   75.4   null

What I would like to get is

C1    C2     C4
------------------
34    43.5   75.4
null  43.5   75.4

Any ideas on how to get it using SQL or I'll need to get everything and filter it out in the code?

2
  • You'll probably need to filter them out in the code, if you want to. But.... null is also a piece of relevant information, isn't it? Commented Apr 28, 2022 at 12:52
  • You can check out this answer but since it's not straight-forward, you might consider filtering with code: stackoverflow.com/questions/1038435/sql-conditional-select Commented Apr 29, 2022 at 15:59

0

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.