Assume I Have an SQL query like this
SELECT player_name,weight,
CASE WHEN weight > 250 THEN 'over 250'
WHEN weight > 200 THEN '201-250'
WHEN weight > 175 THEN '176-200'
ELSE '' END AS weight_group
FROM benn.college_football_players
I want to display the records which are not null(Weight not null) without disturbing the ELSE ' ',because that would cause so many unnecessary errors in the query,is there a workaround for this? I have used
where weight_group is not null
at the end,but it's throwing an error as 'Invalid Identifier'
Any other work around other than putting this entire select condition in another select statement?