==
operador (signo de doble igual)
Se aplica a: Databricks SQL
Databricks Runtime
Devuelve true
si expr1
es igual a expr2
, de lo contrario, devuelve false
. Esta función es un sinónimo del operador = (signo de igual que). Use equal_null
para tratar NULL
como un valor comparable.
Sintaxis
expr1 == expr2
Argumentos
expr1
: expresión de cualquier tipo comparable.expr2
: una expresión que comparte el tipo menos común conexpr1
.
Devoluciones
BOOLEAN
.
Ejemplos
> SELECT 2 == 2;
true
> SELECT 1 == '1';
true
> SELECT true == NULL;
NULL
> SELECT NULL == NULL;
NULL
-- By default string comparisons are trailing blank sensitive
-- This can be overridden by using the COLLATE clause
> SELECT 'hello' == 'hello ' AS default,
'hello' == 'hello ' COLLATE UTF8_BINARY AS utf8_binary,
'hello' == 'hello ' COLLATE UTF8_BINARY_RTRIM AS rtrim;
default utf8_binary rtrim
------- ----------- -----
false false true
-- By default string comparisons are trailing space sensitive
-- This can be overridden by using the COLLATE clause
> SELECT 'world ' == 'world ' AS default,
'world ' == 'world ' COLLATE UTF8_BINARY AS utf8_binary,
'world ' == 'world ' COLLATE UTF8_BINARY_RTRIM AS rtrim;
default utf8_binary rtrim
------- ----------- -----
false false true
Temas relacionados
- <Operador (signo menor que)
- Operador <= (signo menor o igual que)
- > operador (signo mayor que)
- Operador >= (signo mayor o igual que)
- <=> operador (signo menor que, igual que o mayor que)
- Operador != (signo de exclamación e igual que)
- == (signo de doble igual) (operador)
- equal_null (función)
- <>Operador (signo menor que y mayor que)
- Reglas de tipo de datos de SQL
- Intercalación