Re: [SQL] Using the IN predicate in an UPDATE...

Поиск
Список
Период
Сортировка
От Leslie Mikesell
Тема Re: [SQL] Using the IN predicate in an UPDATE...
Дата
Msg-id 199810150321.WAA24646@Jupiter.mcs.net
обсуждение исходный текст
Ответ на Using the IN predicate in an UPDATE...  (Thomas Good <tomg@admin.nrnet.org>)
Ответы Re: [SQL] Using the IN predicate in an UPDATE...  (Thomas Good <tomg@admin.nrnet.org>)
Список pgsql-sql
According to Thomas Good:
> This query takes 20 years (poetic licence invoked ;-).
> Do you have a smarter way to accomplish this end:
>
> UPDATE table1 SET id = 2
> WHERE rec_num IN
>  ( SELECT rec_num
>    FROM table1
>    WHERE id = 1
>   );

Am I missing something here or is this the same as:

UPDATE table1 SET id = 2 WHERE id = 1;

??
  Les Mikesell
    les@mcs.com

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

Предыдущее
От: "Gene Selkov Jr."
Дата:
Сообщение: Re: [SQL] Re: Using the IN predicate in an UPDATE...
Следующее
От: shields@crosslink.net (Michael Shields)
Дата:
Сообщение: Re: [SQL] dilemma