หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Applies to:
Databricks SQL
Databricks Runtime
Returns expr1 if cond is true, or expr2 otherwise. This function is a synonym for if function.
Syntax
iff(cond, expr1, expr2)
Arguments
cond: A BOOLEAN expression.expr1: An expression of any type.expr2: An expression that shares a least common type withexpr1.
Returns
The result is the common maximum type of expr1 and expr2.
Examples
> SELECT iff(1 < 2, 'a', 'b');
a