Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Delete from...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 15953 of 16554
Post > Topic >>

Re: Delete from Join

by lennin.caro@[EMAIL PROTECTED] (Lennin Caro) Jul 3, 2008 at 06:28 AM

--- On Wed, 7/2/08, Gwyneth Morrison <gwynethm@[EMAIL PROTECTED]
> wrote:

> From: Gwyneth Morrison <gwynethm@[EMAIL PROTECTED]
>
> Subject: Re: [GENERAL] Delete from Join
> To: pgsql-general@[EMAIL PROTECTED]
> Date: Wednesday, July 2, 2008, 7:12 PM
> --- On Wed, 7/2/08, Gwyneth Morrison
> <postgres@[EMAIL PROTECTED]
> wrote:
> 
> 
> 
>   > From: Gwyneth Morrison <postgres@[EMAIL PROTECTED]
>
> > Subject: [GENERAL] Delete from Join
> > To: pgsql-general@[EMAIL PROTECTED]
> > Date: Wednesday, July 2, 2008, 3:15 PM
> > Hello,
> > 
> > Is it possible to use a join keyword in a delete?
> > 
> > For example:
> > 
> >      DELETE FROM data_table1
> >                 using data_table2 INNER JOIN
> >                         data_table1  ON
> data_table1.fkey =
> > data_table2.pkey;
> > 
> > 
> > It is not directly mentioned in the delete syntax but
> the
> > delete refers 
> > to the select clause where JOIN is valid.
> > 
> > G
> >               
>   
> 
> 
> >i have a example
> 
> >delete from t1 a using t2 b where a.id = b.oid
> 
> >A standard way to do it is
> 
> >delete from t1 a where id in (select a.id from t1 a
> inner join t2 b on (a.id = b.oid))
> 
> 
>  Thank you for your reply,
> 
>  You are absolutely correct, it IS the standard way. 
> 
> What I am actually trying to do here is write a program to
> convert MS SQL to Postgres.
> I have had quite a bit of success so far, but this is a
> sticking point. 
> 
> Apparently using the JOIN keyword directly in a delete
> statement is valid in MS.
> I am trying to determine if it is valid in postgres which I
> figure it is not but cannot 
> find it exactly in the do***entation. 
> 
> So I guess the real question is, can the JOIN keyword be
> used directly in a delete as above.
> 
> G
> 
> 

i have the same problem. i try use JOIN keyword in DELETE syntax but dont
work. I assume cant use JOIN keywork


      


-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 5 Posts in Topic:
Re: Delete from Join
gwynethm@[EMAIL PROTECTED  2008-07-02 15:12:59 
Re: Delete from Join
gwynethm@[EMAIL PROTECTED  2008-07-03 08:26:52 
Re: Delete from Join
tgl@[EMAIL PROTECTED] (T  2008-07-03 11:29:46 
Re: Delete from Join
lennin.caro@[EMAIL PROTEC  2008-07-03 06:28:38 
Re: Delete from Join
gwynethm@[EMAIL PROTECTED  2008-07-04 10:00:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 22:49:04 CDT 2008.