Respondendo a mim mesmo, só para constar:
A sintaxe do UPDATE[1] no PostgreSQL tem uma clausula "FROM" conforme abaixo:
UPDATE [ ONLY ] table SET column = { expression | DEFAULT } [, ...]
[ FROM fromlist ]
[ WHERE condition ]
fromlist
A list of table expressions, allowing columns from other tables to
appear in the WHERE condition and the update expressions. This is
similar to the list of tables that can be specified in the FROM Clause
of a SELECT statement. Note that the target table must not appear in
the fromlist, unless you intend a self-join (in which case it must
appear with an alias in the fromlist).
Na realidade quem estava precisando disso era uma amigo meu, então eu
não testei pra ver como funciona mas segundo ele isso serviu bem.
[1] http://www.postgresql.org/docs/8.1/interactive/sql-update.html
Em 15/08/07, Welington R. Braga<[EMAIL PROTECTED]> escreveu:
> Olá todos,
>
>
> A sintaxe abaixo é válida:
>
> INSERT INTO tabela1 SELECT * FROM tabela1 WHERE campo1='blabla'
>
>
> Mas eu preciso de algo como:
>
> UPDATE INTO tabela1 SELECT * FROM tabela1 WHERE campo1='blabla'
>
> Existe algo similar a isso no postgresql?
>
> --
> Welington Rodrigues Braga
> --------------
> Web: http://gtk-br.welrbraga.t5.com.br
> MSN: welrbraga[*]msn·com
> Gtalk: welrbraga[*]gmail·com
> Yahoo / Skype: welrbraga
> ICQ: 52789331
>
> "Em tudo somos atribulados, porém não angustiados; perplexos, porém
> não desanimados; perseguidos, porém não desamparados; abatidos, porém
> não destruídos;" - 2Co 4:8,9
>
--
Welington Rodrigues Braga
--------------
Web: http://gtk-br.welrbraga.t5.com.br
MSN: welrbraga[*]msn·com
Gtalk: welrbraga[*]gmail·com
Yahoo / Skype: welrbraga
ICQ: 52789331
"Em tudo somos atribulados, porém não angustiados; perplexos, porém
não desanimados; perseguidos, porém não desamparados; abatidos, porém
não destruídos;" - 2Co 4:8,9
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral