query syntax change?
От
Ed Loehr
Тема
query syntax change?
Дата
Msg-id
3B45EE6A.332F566D@austin.rr.com
Список
Дерево обсуждения
Re: order by + union (was: query syntax change?) Ed Loehr <eloehr@austin.rr.com>
Re: order by + union (was: query syntax change?) Tom Lane <tgl@sss.pgh.pa.us>
This query works in 7.0.3...
SELECT p.*, e.id AS "employee_id", e.ref_name,
e.business_line_id, e.record_status_id AS "emp_record_status_id"
FROM person p, employee e
WHERE e.person_id = p.id
UNION ALL
SELECT p.*, NULL AS "employee_id", NULL AS "ref_name",
NULL AS "business_line_id", NULL AS "emp_record_status_id"
FROM person p
WHERE NOT EXISTS (SELECT id FROM employee WHERE person_id = p.id)
ORDER BY p.sortable_last_name;
but in 7.1.2 it reports the following error:
ERROR: Relation 'p' does not exist
Anyone understand why?
Regards,
Ed Loehr
В списке pgsql-general по дате отправления