File: test_case_statement_parsing.sql

package info (click to toggle)
sqlfmt 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,580 kB
  • sloc: python: 10,007; sql: 5,626; makefile: 39
file content (20 lines) | stat: -rw-r--r-- 551 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
select
    my_first_field,
    my_second_field as an_alias,
    case
        when another_field = some_other_value
        then some_really_long_value
    end as my_case_statement,
    case
        when caser
            then some_really_really_long_value_to_wrap_this_next_line
        else
            42
    end,
    CASE
        when (my_field) then end_field
    END::numeric(10, 2) as casted_case,
    (case when ending then false end)+(case when 2 then true end)::varchar(10),
    another_field,
    case when true then 10 end+4
from some_table