Blank line between CASE arms
blankLineBetweenCaseArms writes an empty line between the arms of a case once two or more of
its arms each take more than one line.
Default: true. An arm that does not fit on one line puts its then on a line of its own, and
two such arms one after the other are four lines that all begin at the same column. A select item
ends with its comma, so you can see where it stops; an arm ends with nothing, and the only sign
that the next one has begun is the word when. The empty line makes each arm a paragraph.
It is all the arms or none of them. When the empty lines go in, they go between every pair of
arms, the short ones and the else included, so the case does not change shape from one arm to
the next. A case whose arms each fit on a line is left alone, and so is one where only a single
arm spans lines: its neighbours are one line each, and that already shows where it ends.
false stacks the arms with nothing between them.
It controls only the adding. An empty line you wrote between two arms yourself is blankLines' business and is kept under either value. In a client script whose client reads an empty line as the end of a statement, it is forced off whatever it is set to.
Arms that span lines
select case when customer_region = 'EU' and order_total > 1000 then 'european high value' when customer_region = 'US' and order_total > 2000 then 'american high value' else 'standard' end as segment from ordersselect
case
when customer_region = 'EU' and order_total > 1000
then 'european high value'
when customer_region = 'US' and order_total > 2000
then 'american high value'
else 'standard'
end as segment
from ordersselect case when customer_region = 'EU' and order_total > 1000 then 'european high value' when customer_region = 'US' and order_total > 2000 then 'american high value' else 'standard' end as segment from ordersselect
case
when customer_region = 'EU' and order_total > 1000
then 'european high value'
when customer_region = 'US' and order_total > 2000
then 'american high value'
else 'standard'
end as segment
from orders