update syntax

From: "Praveen Raja" <praveen(dot)raja(at)netlight(dot)se>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: update syntax
Date: 2005-06-15 11:39:11
Message-ID: 002401c5719e$dc9682b0$4c0ca8c0@sek.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message KÖPFERL Robert 2005-06-15 12:14:46 Converting varchar to bool
Previous Message Greg Sabino Mullane 2005-06-15 02:06:20 Re: getting details about integrity constraint violation