Re: case when... end in update clause?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: case when... end in update clause?
Дата
Msg-id dcc563d10803120901j5f6bd4as8eae1320318b7060@mail.gmail.com
обсуждение исходный текст
Ответ на case when... end in update clause?  (Emi Lu <emilu@encs.concordia.ca>)
Ответы Re: case when... end in update clause?
Список pgsql-sql
On Wed, Mar 12, 2008 at 8:47 AM, Emi Lu <emilu@encs.concordia.ca> wrote:
> Hello,
>
>  May I know can "case when " used by update clause. If yes, how?
>
>  I use one small Example, table: test
>  =============================
>  id
>  ==
>  5
>  6
>  8
>
>  try to update test.id
>
>
>  update test
>
>  case
>   when id =5 then SET id = 6
>  end
>  ;

would this work:

update test set id=5 where id=6;

???


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

Предыдущее
От: Emi Lu
Дата:
Сообщение: Re: case when... end in update clause?
Следующее
От: Emi Lu
Дата:
Сообщение: Re: case when... end in update clause?