tencent cloud

Stream Compute Service

Condition Functions

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2023-11-08 14:19:01
Conditional functions are described as follows:
Function
Description
CASE valueWHEN value1 [, value11 ] THEN result1[ WHEN valueN [, valueN1 ] THEN resultN ]* [ ELSE resultZ ] END
Returns result1 when the value is contained in the range of value1 to value11.
Returns resultN when the value is contained in the range of valueN to valueN1.
Returns resultZ when no value matches.
CASEWHEN condition1 THEN result1[ WHEN conditionN THEN resultN ] * [ ELSE resultZ ] END
Returns result1 when condition1 is met.
Returns resultN when conditionN is met.
Returns resultZ when no condition is met.
NULLIF(value1, value2)
Returns NULL if value1 is equal to value2; returns value1 otherwise. For example, NULLIF(5, 5) returns NULL, and NULLIF(5, 0) returns 5.
COALESCE(value, value [, value ]* )
Returns the first parameter that is not NULL. For example, COALESCE(NULL, 5) returns 5.
IF(condition, true_value, false_value)
Returns the true_value if condition is met, otherwise the false_value. For example, IF(2 > 1, 2, 1) returns 2, and IF (1 > 2, 99, 100) returns 100.
IS_ALPHA(string)
Checks whether string contains only letters. Returns true if so, otherwise false.
IS_DECIMAL(string)
Checks whether string is a valid number (integer, decimal, or negative number). Returns true if so, otherwise false.
IS_DIGIT(string)
Checks whether string contains only digits (i.e., an unsigned integer). Returns true if so, otherwise false.
IF_NULL_STR(str, defaultValue)
Returns the value of str itself if it is not NULL; otherwise, returns the value of defaultValue.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백