I need to display a particular column in my SQL result only if it is not null. If it is null, I don’t want that column to appear at all in my result.
Is there a way to express this condition in SQL?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This wouldn’t make sense because a query may return multiple rows. One row may have a value for the column in question and the next may not have a value. Then a conditional column would create a structural inconsistency between returned rows.