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
demandé il y a 3 ans203 vues
2 réponses
0
Réponse acceptée

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
répondu il y a 3 ans
0

VALUES worked, thank you.

dwery
répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions