query

Row subqueries

Compare a row value with a single-row subquery of matching arity. NULL components may make the comparison unknown.

Formal Syntax & Structure

sql syntaxsql
(x,y) = (SELECT x,y FROM source)

Working Example

Example Snippetsql
CREATE TABLE a(id int primary key,k int); CREATE TABLE b(k int); INSERT INTO a VALUES (1,10),(2,20),(3,NULL); INSERT INTO b VALUES (10),(10),(NULL);SELECT (1,10) = (SELECT id,k FROM a WHERE id=1);
SQL Reference