From: Tomasz Myrta <jasiek@klaster.net>
To: Rajesh Kumar Mallah <mallah@trade-india.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Joined deletes but one table being a subquery.
Date: Mon, 25 Aug 2003 07:59:59 +0200
Message-ID: <3F49A5DF.1040405@klaster.net> (raw)
In-Reply-To: <200308231500.37736.mallah@trade-india.com>
References: <200308221531.13782.mallah@trade-india.com>
<3F45EF2E.7060709@klaster.net>
<200308231500.37736.mallah@trade-india.com>
> I apologize for the silence.
>
> t_a as been created as
>
> CREATE TABLE t_a as SELECT userid,category_id from eyp_listing where userid=21742 and size ilike '%WEBFL%'
> EXCEPT SELECT userid,category_id from company_export_profile where userid=21742 ;
>
> so the subquery is basically
>
> ( SELECT userid,category_id from eyp_listing where userid=21742 and
> size ilike '%WEBFL%' EXCEPT SELECT userid,category_id from company_export_profile
> where userid=21742 )
>
>
> regds
> mallah.
What about this?
delete from eyp_listing where exists (select * from
eyp_listing el
left join company_export ce using (userid,category_id)
where el.userid=21742 and size ilike '%WEBFL%' and ce.userid is null
and el.userid=eyp_listing.userid
and el.category_id=eyp_listing.category_id);
It should be solution, but not the answer for your question...
How did you use that sub-select, so it didn't work?
Regards,
Tomasz Myrta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasiek@klaster.net, mallah@trade-india.com
Subject: Re: Joined deletes but one table being a subquery.
In-Reply-To: <3F49A5DF.1040405@klaster.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox