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
feita há 3 anos203 visualizações
2 Respostas
0
Resposta aceita

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
respondido há 3 anos
0

VALUES worked, thank you.

dwery
respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas