update only if single row

Поиск
Список
Период
Сортировка
От Frank Bax
Тема update only if single row
Дата
Msg-id 3.0.6.32.20000406132216.008a8420@execulink.com
обсуждение исходный текст
Ответы Re: update only if single row  ("tjk@tksoft.com" <tjk@tksoft.com>)
Список pgsql-sql
Here's the way I do it now:

select * from contact where email ~* 'rvro';
if I get a single row in the result then I enter:
update contact set bounce=1 where  email ~* 'rvro';

Can I combine this into a single SQL statement with the following
requirements:
1) the update is only performed if a single row is selected
2) I only enter the selection string ('rvro' in this case) once in the
command?

Frank


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

Предыдущее
От: Ryan Bradetich
Дата:
Сообщение: Datetime as a time_t?
Следующее
От: Michael Fork
Дата:
Сообщение: Re: Datetime as a time_t?