pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Praveen Raja <praveen.raja@netlight.se>
To: pgsql-sql@postgresql.org
Subject: update syntax
Date: Wed, 15 Jun 2005 13:39:11 +0200
Message-ID: <002401c5719e$dc9682b0$4c0ca8c0@sek.se> (raw)

Hi,

 

While using Ms SQL server I used to write update statements like this,

 

UPDATE a SET a.col1 = b.col1

FROM table1 a

INNER JOIN table1 b

ON a.col2 = b.col2

WHERE a.col3 = 'something'

AND b.col3 = 'somethingelse'

 

But I can't seem to do this in postgres, it gives me an error saying
'syntax error at or near "."'. How can I do something similar to this
i.e. join on the same table?

 

Thanks,

/P

view thread (5+ messages)  latest in thread

Message-ID: <002401c5719e$dc9682b0$4c0ca8c0@sek.se>
Permalink:  ../002401c5719e$dc9682b0$4c0ca8c0@sek.se/
Also on:    postgresql.org/message-id/002401c5719e$dc9682b0$4c0ca8c0@sek.se

 · 

reply

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: praveen.raja@netlight.se
  Subject: Re: update syntax
  In-Reply-To: <002401c5719e$dc9682b0$4c0ca8c0@sek.se>

* 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