Re: DELETE WHERE EXISTS unexpected results

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: DELETE WHERE EXISTS unexpected results
Дата
Msg-id id7itt$69m$3@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на DELETE WHERE EXISTS unexpected results  (Jeff Bland <bland@us.ibm.com>)
Список pgsql-sql
On 2010-11-30, Jeff Bland <bland@us.ibm.com> wrote:
> This is a multipart message in MIME format.
> --=_alternative 007A6509852577EB_=
> Content-Type: text/plain; charset="US-ASCII"
>
> I want to delete certain rows from table USER_TBL. 
> Two tables are involved.  USER_TBL and OWNER_TBL. 

delete ... using  was invented for this purpose.

> In the end I expect the USER_TBL to  not contain the 3  HOME  entries. 
> But what is happening is the whole USER_TBL is empty after the query. 

your subselect is being effected by the table used in the delete.

-- 
⚂⚃ 100% natural


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

Предыдущее
От: Jeff Bland
Дата:
Сообщение: Re: DELETE WHERE EXISTS unexpected results
Следующее
От: Dimitri
Дата:
Сообщение: Calculate next event date based on instance of the day of week