Using ANY()

Поиск
Список
Период
Сортировка
От Shakil Shaikh
Тема Using ANY()
Дата
Msg-id BAY117-DS9D5308E45D1027621F8C2AC460@phx.gbl
обсуждение исходный текст
Ответы Re: Using ANY()  (Jeff Davis <pgsql@j-davis.com>)
Re: Using ANY()  ("Shakil Shaikh" <sshaikh@hotmail.com>)
Список pgsql-general
Hi all,

Is it appropriate to use ANY() in a select statement as so?

SELECT * FROM table t WHERE t.id = ANY(ARRAY[1,2,3]);

A less trivial usage of the above would be to pass an array to a simple
function using it to return a range of arbitrary rows. The alternative to
this would be to (programmatically) call the function multiple times on a
list of arguments. Some questions:

1) How does ANY() behave on indexed columns?

2) How does ANY() behave when passed an array with one element?

3) Generally is it better to use ANY on a passed ARRAY, or to just call a
select multiple times (and aggregate the results)? Is ANY just a glorified
OR?

Shak


В списке pgsql-general по дате отправления:

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: How to store text files in the postgresql?
Следующее
От: Ron Mayer
Дата:
Сообщение: Re: INTERVAL SECOND limited to 59 seconds?