Re: update syntax

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: update syntax
Дата
Msg-id 20050615143416.GD7595@wolff.to
обсуждение исходный текст
Ответ на Re: update syntax  ("Praveen Raja" <praveen.raja@netlight.se>)
Список pgsql-sql
On Wed, Jun 15, 2005 at 14:35:42 +0200, Praveen Raja <praveen.raja@netlight.se> wrote:
> Thanks. The UPDATE works ok now. But using the same logic it doesn’t
> seem possible to delete rows. Is this also possible?

Yes. When you use table names in the where clause they are automatically
added to the join list if they aren't list in the from item list.

For 8.1 this will be changing. There will be a USING clause on DELETE
statements that can be used to list extra tables and the implied
from feature will be disabled by default.

> 
> 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’


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Converting varchar to bool
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: SELECT very slow