Re: switching from mysql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: switching from mysql
Дата
Msg-id 9314.1005939322@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: switching from mysql  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-novice
"Josh Berkus" <josh@agliodbs.com> writes:
> However, you should consider that neither MySQL's implementation of
> GROUP BY, nor SELECT DISTINCT ON, is ANSI-compliant SQL.  Therefore
> portablility of either approach is limited.

A spec-compliant way to do it (assuming I've correctly understood
Brad's problem) is:

select items.* from items where
exists(select 1 from store_items where items.id = store_items.item_id);

However this has got performance problems in current Postgres releases
(soluble problems, but not solved yet), and I'm not sure if it works
at all in current MySQL releases --- I know they're working on subselect
support, but not sure if it's in any stable release yet.

So you're kinda stuck with one of the nonstandard approaches :-(

            regards, tom lane

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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: switching from mysql
Следующее
От: Francisco Reyes
Дата:
Сообщение: Drop table vs begin/end transaction