SELECT CASE
WHEN fred = 1
AND george = 2
THEN
'woohoo'
ELSE
'bah'
FROM table1
WHERE bob != 3
SELECT CASE
WHEN fred = 1
AND george = 2
THEN
'woohoo'
ELSE
'bah'
FROM table1
WHERE bob != 3
AND alfred = 4;
This means I then have to apply some manual formatting in order to get the query as I want it.
I’ve been through the formatter options, and I couldn’t find anything that differentiates between ANDs/ORs in operators (eg. case statements and the like) and those in the where clause.
Am I missing something, or is this just not possible for the formatter to handle?
ie. I’d like:
select case when fred = 1 and george = 2 then ‘woohoo’ else ‘bah’ end
from table1
where bob != 3
and alfred = 4;
to be formatted to:
ENDAND alfred = 4;
However, as things stand, the ANDs in the WHERE clause line up under the first where condition, ie:
END