# E061-13: Correlated subqueries

statement ok
CREATE TABLE TABLE_E061_13_01_011 ( ID INT PRIMARY KEY, A INT );

statement ok
CREATE TABLE TABLE_E061_13_01_012 ( ID INT PRIMARY KEY, B INT );

query I
SELECT A FROM TABLE_E061_13_01_011 WHERE A IN ( SELECT B FROM TABLE_E061_13_01_012 WHERE B = A );

statement ok
CREATE TABLE TABLE_E061_13_01_021 ( ID INT PRIMARY KEY, A INT );

statement ok
CREATE TABLE TABLE_E061_13_01_022 ( ID INT PRIMARY KEY, B INT );

query I
SELECT A FROM TABLE_E061_13_01_021 WHERE A NOT IN ( SELECT B FROM TABLE_E061_13_01_022 WHERE B = A );
