UPDATE query with variable number of OR conditions in WHERE

Поиск
Список
Период
Сортировка
От JORGE MALDONADO
Тема UPDATE query with variable number of OR conditions in WHERE
Дата
Msg-id CAAY=A7-JA3iaitwjh+kYAsq0frUqBGkauwYVSSWBqz-feDAO7Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: UPDATE query with variable number of OR conditions in WHERE  (Ben Morrow <ben@morrow.me.uk>)
Список pgsql-sql
I am building an UPDATE query at run-time and one of the fields I want to include in the WHERE condition may repeat several times, I do not know how many. 

UPDATE table1 
SET field1 = "some value" 
WHERE (field2 = value_1 OR field2 = value_2 OR .....OR field2 = value_n)

I build such a query using a programming language and, after that, I execute it. Is this a good approach to build such a query?

Respectfully,
Jorge Maldonado

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bug in 9.2.2 ? subquery accepts wrong column name : upd
Следующее
От: Ben Morrow
Дата:
Сообщение: Re: UPDATE query with variable number of OR conditions in WHERE