הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Returns true if elem equals any exprN or a row in query.
Syntax
elem in ( expr1 [, ...] )
elem in ( query )
in ( elem, expr1 [, ...] )
Arguments
elem: An expression of any comparable type.exprN: An expression of any type sharing a least common type with all other arguments.query: Any query. The result must share a least common type withelem. If the query returns more than one columnelemmust be an tuple (STRUCT) with the same number of field
Returns
The results is a BOOLEAN.
Examples
> SELECT 1 in(1, 2, 3);
true
> SELECT 1 in(2, 3, 4);
false
> SELECT (1, 2) IN ((1, 2), (2, 3));
true
> SELECT named_struct('a', 1, 'b', 2) in(named_struct('a', 1, 'b', 1), named_struct('a', 1, 'b', 3));
false
> SELECT named_struct('a', 1, 'b', 2) in(named_struct('a', 1, 'b', 2), named_struct('a', 1, 'b', 3));
true
> SELECT 1 IN (SELECT * FROM VALUES(1), (2));
true;
> SELECT (1, 2) IN (SELECT c1, c2 FROM VALUES(1, 2), (3, 4) AS T(c1, c2));
true;
> SELECT in(1, 1, 2, 3);
true
> SELECT in(1, 2, 3, 4);
false
> SELECT in((1, 2), (1, 2), (2, 3));
true