Re: update syntax

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: update syntax
Дата
Msg-id 200201270340.g0R3e7813150@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: update syntax  (chester c young <chestercyoung@yahoo.com>)
Список pgsql-sql
chester c young wrote:
> thanks, but how would this be done for the same table?
> 
> update table1 t1 set (c2, c3 ) = 
> ( select c2, c3 from table1 t2 where t1.c1 = t2.c1 and t1.oid < t2.oid
> );

In that 'FROM c1 c2', c2 was a table alias for table c1.  That is how
you get the second instance of c1.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-sql по дате отправления:

Предыдущее
От: chester c young
Дата:
Сообщение: Re: update syntax
Следующее
От: pgsql
Дата:
Сообщение: options for no multiple rows?