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
gefragt vor 3 Jahren203 Aufrufe
2 Antworten
0
Akzeptierte Antwort

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
beantwortet vor 3 Jahren
0

VALUES worked, thank you.

dwery
beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen