FROM t1 JOIN t2 ON t1.id = t2.id
)
- Original Message -
From: "Vincent Hikida" <[EMAIL PROTECTED]>
To: "peter pilsl" <[EMAIL PROTECTED]>; "PostgreSQL List"
<[EMAIL PROTECTED]>
Sent: Saturday, December 18, 2004 12:40 AM
S
One solution is
SELECT COALESCE(t1.id,t2.id)
, COALESCE(t1.name,t2.name)
FROM t1 FULL JOIN t2 ON t1.id = t2.id
- Original Message -
From: "peter pilsl" <[EMAIL PROTECTED]>
To: "PostgreSQL List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 15, 2004 1:03 PM
Subject: [GENERA
You probably want something more like:
SELECT DISTINCT ON (id), * FROM
(
UNION ALL
);
The fact that UNION sorts at all is a side-effect of the
implementation. The distinct part is part of the SQL spec. Use UNION
ALL to get all the rows and then DISTINCT ON to do what you actually
want..