Skip to content

Case Expression (Direct)

case expression

1
2
3
4
5
6
7
8
 select
    case when a.kamut=1 and b.teur IS null
             then 'no locks'
         when a.kamut=1
            then b.teur
    else 'locks'
    end teur
 from tbl a left join TT b on (a.key=b.key)

During the analyzing of dataflow, case expression is treated as a function. The column used inside the case expression will be treated like the arguments of a function. So for the above SQL, the following relation is discovered:

1
2
tbl.kamut -> direct -> teur
TT.teur -> direct -> teur

diagram

image.png