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
Список 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 по дате отправления: