Re: UPDATE ... FROM vs standard SQL

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: UPDATE ... FROM vs standard SQL
Дата
Msg-id 200206071150.55227.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: UPDATE ... FROM vs standard SQL  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
Richard,

> Tell me about it. Where I'm using MySQL on client web-servers I find myself
> porting the data into PG to massage it then putting the results back into
> MySQL. One of the things missing from the various reviews/comparisons on the
> web is any actual comparison of usage for DBA tasks (as opposed to handling
a
> message-board app etc)

But MySQL does handle message-baord apps very well.  If only MySQL AB and
NuSphere would stick to that and not try to poach in transactional database
space ...

> Nope - mostly work with PG/MySQL/MS-SQL/Access. I use all the features at
the
> psql prompt, but like to stick to the standard for app-generated queries.

Well, this will work on any database with *full* SQL92 support:

UPDATE tablea SET field3 = (SELECT field5                    FROM tableb                    WHERE tableb.field2 =
tablea.field1);

... and won't be as slow as an IN query.  Quite.

However, MS SQL 7.0 does not support correlated subqueries outside of the
WHERE clause (I'm not sure about SQL 2000).   For MS Access, well, forget
using subqueries at all unless you have all day ...

And for MySQL, you're hosed.   Tell your clients they need a different
database.

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________                                       Josh Berkus  Complete
informationtechnology     josh@agliodbs.com   and data management solutions     (415) 565-7293  for law firms, small
businesses     fax 621-2533   and non-profit organizations.     San Francisco 



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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: PL/pgSQL TODO
Следующее
От: Maurício Sessue Otta
Дата:
Сообщение: Limiting database size