union query

From: "Tamsin" <tg_mail(at)bryncadfan(dot)co(dot)uk>
To: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: union query
Date: 2001-01-12 14:53:13
Message-ID: NEBBKHBOBMJCHDMGKCNJIEEFCIAA.tg_mail@bryncadfan.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Just spent an hour getting nowhere, til I discovered this (description is a
varchar field):

select description from address union select 'other';

fine but...

select 'other' union select description from address;
ERROR: Unable to transform varchar to unknown
Each UNION | EXCEPT | INTERSECT clause must have compatible target
types

Its not a problem, as I now I've worked it out I can do what I wanted (a
long nasty union to get around some outer join issues), but I just wondered
if the order of the selects in a union should matter?

tamsin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-01-12 15:18:14 Re: MacOS X
Previous Message Adam Lang 2001-01-12 14:40:16 Re: xml middleware