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