Skip to content

sql: ANY/ALL with subqueries #17662

@justinj

Description

@justinj

We currently support ANY and ALL with ARRAYs:

root@:26257/> SELECT 3 = ALL ARRAY[3,3,3];
+------------------------+
| 3 = ALL ARRAY[3, 3, 3] |
+------------------------+
| true                   |
+------------------------+
(1 row)

Time: 1.991091ms

root@:26257/> SELECT 3 = ALL ARRAY[3, 3, 4];
+------------------------+
| 3 = ALL ARRAY[3, 3, 4] |
+------------------------+
| false                  |
+------------------------+
(1 row)

Time: 532.323µs

We should also support this with (uncorrelated) subqueries:

root@:26257/> SELECT 3 = ALL (SELECT 3);
pq: unsupported comparison operator: 3 = ALL (SELECT 3): op ALL array requires array on right side
root@:26257/> SELECT 3 = ANY (SELECT 3);
pq: unsupported comparison operator: 3 = ANY (SELECT 3): op ANY array requires array on right side

cc @knz @nvanbenschoten

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions