Using the query INTERSECTion

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Using the query INTERSECTion
Дата
Msg-id 200706181610.41688.vincenzo.romano@gmail.com
обсуждение исходный текст
Ответы Re: Using the query INTERSECTion  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Hello everyone.

In order to build some dynamic queries (EXECUTE under PL/PgSQL)
I'm taking in consideration to use the INTERSECT operator in order
to split a WHERE-condition in a static one and a dynamic one to be
built at runtime.

Instead of

SELECT * FROM joinedtables WHERE static_cond AND dynamic_cond;

I could use:

SELECT * FROM joinedtables WHERE static_cond
  INTERSECT
SELECT * FROM joinedtables WHERE dynamic_cond

I'm wondering what'd be the difference in efficiency between these
two queries.

Is there any advise?

Many thanks in advance.

--
Vincenzo Romano
--
Maybe Computer will never become as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1988]

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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Loop through all views with PHP
Следующее
От: Francisco Reyes
Дата:
Сообщение: Re: Command line export or copy utility?