IF (Lakehouse v1)
Si <cond1> est TRUE, renvoie <expr1>. Sinon, si <cond2> est TRUE, renvoie <expr2>, et ainsi de suite.
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.if_(<cond1>, <expr1>, [<cond2>, <expr2> ...], <expr_else>)Exemples Analyze
Section intitulée « Exemples Analyze »func.if_((1 > 2), 3, (4 < 5), 6, 7)
┌─────────────────────────────────────┐│ func.if_((1 > 2), 3, (4 < 5), 6, 7) │├─────────────────────────────────────┤│ 6 │└─────────────────────────────────────┘Syntaxe SQL
Section intitulée « Syntaxe SQL »IF(<cond1>, <expr1>, [<cond2>, <expr2> ...], <expr_else>)Exemples SQL
Section intitulée « Exemples SQL »SELECT IF(1 > 2, 3, 4 < 5, 6, 7);
┌───────────────────────────────┐│ if((1 > 2), 3, (4 < 5), 6, 7) │├───────────────────────────────┤│ 6 │└───────────────────────────────┘