Re: missing FROM-clause notice but nothing is missing ...

Поиск
Список
Период
Сортировка
От Hadley Willan
Тема Re: missing FROM-clause notice but nothing is missing ...
Дата
Msg-id 3E83E5AA.30008@deeperdesign.co.nz
обсуждение исходный текст
Ответ на Re: missing FROM-clause notice but nothing is missing ...  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список pgsql-general
Jean-Christian Imbeault wrote:

> No go with the view ... same error:
>
> DB=# SELECT products.id
>      FROM products
>      WHERE name ILIKE 'AA'
>
>      UNION
>
>      SELECT prod_id
>      FROM v_products_cast_crews
>      WHERE cast_crew=1012
>
>      ORDER BY products.id;
>
> NOTICE:  Adding missing FROM-clause entry for table "products"
> ERROR:  ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of
> the result columns
>
Strange, I actually quickly whipped up the tables and it worked for me?
You did adjust some of the column names appropriately?
Also, the LEFT JOIN's are best treated as a single line too.

Anyway, I looked further in and I see you've got it working.

Still, views are a more convenient way than doing manual UNIONs all the
time.

H


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: missing FROM-clause notice but nothing is missing ...
Следующее
От: Ezra
Дата:
Сообщение: DOES THE UNDERSCORE(_) WILD CARD EXISTS IN POSTGRESQL