Unable to use ANY(), ALL(), SOME()

0

Has anyone seen an error like:
Problems with function : ANY. Either the function does not exist, or there is a problem with a dependent function

SELECT * FROM "mytable"."temperature" WHERE device_name <> ANY('Foo', 'Bar')

Edited by: dwery on Nov 22, 2020 9:50 AM

dwery
asked 3 years ago181 views
2 Answers
0
Accepted Answer

The keyword VALUES should be used if the comparison values is a list of literals e.g. SELECT * FROM "mytable"."temperature" WHERE device_name ANY(VALUES 'Foo', 'Bar'). Same for ALL and SOME too. The alternative syntax is
SELECT * FROM "mytable"."temperature" WHERE device_name ANY (SELECT 'Foo' UNION ALL SELECT 'Bar')

AWS
answered 3 years ago
0

VALUES worked, thank you.

dwery
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions