Re: Delete with join -- deleting related table entries?

Поиск
Список
Период
Сортировка
От Markus Schaber
Тема Re: Delete with join -- deleting related table entries?
Дата
Msg-id 43EA3082.1010804@logix-tt.com
обсуждение исходный текст
Ответ на Re: Delete with join -- deleting related table entries?  (Bryce Nesbitt <bryce1@obviously.com>)
Ответы Re: Delete with join -- deleting related table entries?  (Bryce Nesbitt <bryce1@obviously.com>)
Список pgsql-sql
Hi, Bryce,

Bryce Nesbitt wrote:

> BEGIN;
>   DELETE FROM note WHERE issue_id IN (SELECT issue_id FROM isuse
>       WHERE reservation_id IN
>      (select reservation_id from reservations where date > magic);
>   DELETE FROM isuse WHERE reservation_id IN
>      (select reservation_id from reservations where date > magic)
>   DELETE FROM reservations WHERE reservation_id IN
>      (select reservation_id from reservations where date > magic)
> COMMIT;
> 
> I suppose I can do the subselect as a perl wrapper, but I was thinking
> that maybe SQL could do it all for me....

Why do you think this won't work? (provided you add the missing ) and ; :-)

Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org


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

Предыдущее
От: Bryce Nesbitt
Дата:
Сообщение: Re: Delete with join -- deleting related table entries?
Следующее
От: "Owen Jacobson"
Дата:
Сообщение: Re: Delete with join -- deleting related table entries?