Re: How to push predicate down

Поиск
Список
Период
Сортировка
От Volodymyr Kostyrko
Тема Re: How to push predicate down
Дата
Msg-id 4F216817.4080800@gmail.com
обсуждение исходный текст
Ответ на How to push predicate down  (salah jubeh <s_jubeh@yahoo.com>)
Ответы Re: How to push predicate down  (salah jubeh <s_jubeh@yahoo.com>)
Список pgsql-general
salah jubeh wrote:
>
> Hello Guys,
>
> In the past I had a view defined as follows
>
> CREATE view abcd as
> SELECT whatever ...... --- query1
>
> Some business requierments came up and I had to change it like this
>
> CREATE view abcd as
> SELECT whatever ...... --- query1
> UNION
> SELECT whatever ......---- query2

1. You sure you need UNION and not UNION ALL?

2. Can you post more detail example?

For example:

select anything from first_table
union
select anything from second_table
where anything == something;

This way WHERE clause is a part of second subselect and will not be
propagated to the first one.

--
Sphinx of black quartz judge my vow.

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

Предыдущее
От: Szymon Guz
Дата:
Сообщение: Re: Let-bindings in SQL statements
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: Let-bindings in SQL statements