MySQL Forums
Forum List  »  Newbie

Re: Filter to show just one column
Posted by: Peter Brawley
Date: March 04, 2017 12:19PM

You could use a case statement in the Select clause, eg ...

select case col when 'a' then a when 'b' then b ... end ...

but that doesn't get you the column heading. SQL is by design quite literal-minded, so usually it's best to implement such Select expression branching in application code.

Options: ReplyQuote


Subject
Written By
Posted
Re: Filter to show just one column
March 04, 2017 12:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.