Re: update syntax
От | Bruno Prévost |
---|---|
Тема | Re: update syntax |
Дата | |
Msg-id | 006b01c571a4$dbbb7d40$5d00a8c0@BRUNO2500 обсуждение исходный текст |
Ответ на | update syntax ("Praveen Raja" <praveen.raja@netlight.se>) |
Ответы |
Re: update syntax
|
Список | pgsql-sql |
Try something like this
UPDATE table1
SET col1 = b.col1
FROM table1 b
WHERE table1.col2 = b.col2 and
table1.col3 = something and
b.col3 = somethingelse
SET col1 = b.col1
FROM table1 b
WHERE table1.col2 = b.col2 and
table1.col3 = something and
b.col3 = somethingelse
----- Original Message -----
From: Praveen RajaSent: Wednesday, June 15, 2005 7:39 AMSubject: [SQL] update syntaxHi,
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 cant 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
В списке pgsql-sql по дате отправления: