Re: Difference between "in (...)" and "= any(...)" queries when using arrays
В списке pgsql-general по дате отправления:
| От | Richard Huxton |
|---|---|
| Тема | Re: Difference between "in (...)" and "= any(...)" queries when using arrays |
| Дата | |
| Msg-id | 4A092D17.1020608@archonet.com обсуждение исходный текст |
| Ответ на | Difference between "in (...)" and "= any(...)" queries when using arrays ("Francisco Figueiredo Jr." <francisco@npgsql.org>) |
| Ответы |
Re: Difference between "in (...)" and "= any(...)" queries
when using arrays
|
| Список | pgsql-general |
Francisco Figueiredo Jr. wrote: > Hi all! > > I was playing with "in (...)" and "= any (...)" queries and found a > difference between them and I wonder: > > why this works: > > select * from table_of_integers where integer_column = any (array[5,6]); This checks if integer_column matches any value in the specified array. > select * from table_of_integers where integer_column in (array[5,6]); This checks if integer_column IS an array[5,6] (which it isn't). You probably want ... IN (5,6) > SOME is a synonym for ANY. IN is equivalent to = ANY. I think this is probably talking with respect to sub-queries. -- Richard Huxton Archonet Ltd
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера