Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: datatype

Re: datatype

From: Christopher <chris.lo_at_cyberwisdom.net>
Date: Mon, 15 Jan 2001 18:15:53 +0800
Message-ID: <93uifh$26n$1@horn.hk.diyixian.com>

It is still complaining the same error.

"Stephan Langer" <slanger_at_dixi-wc.de> wrote in message news:3A62C580.89E496F9_at_dixi-wc.de...
> Hi Christopher,
>
> what about changing the order of the two selects. AFAIK in the first
> select of an union alle columns must have defined types (i.e. not NULL)
> (and names?).
>
> hth
> Stephan
>
> Christopher schrieb:
>
> > I got "ORA-01790: expression must have same datatype as corresponding
> > expression"
> > when executing the following SQL statment :
> >
> > select A.gpm_ent_id_group A_id
> > ,NULL B_id
> > from GroupMember A
> > where A.gpm_ent_id_member = 6
> > UNION
> > select A.gpm_ent_id_group A_id
> > ,B.gpm_ent_id_group B_id
> > from GroupMember A, GroupMember B
> > where A.gpm_ent_id_member = 6
> > and A.gpm_ent_id_group = B.gpm_ent_id_member ;
> >
> > p.s. Both gpm_ent_id_member and gpm_ent_id_group are NUMBER(38)
> >
> > So I modify the SQL to :
> >
> > select A.gpm_ent_id_group A_id
> > ,to_number(NULL) B_id
> > from GroupMember A
> > where A.gpm_ent_id_member = 6
> > UNION
> > select A.gpm_ent_id_group A_id
> > ,B.gpm_ent_id_group B_id
> > from GroupMember A, GroupMember B
> > where A.gpm_ent_id_member = 6
> > and A.gpm_ent_id_group = B.gpm_ent_id_member ;
> >
> > However, it is not an ANSI SQL. Is there any ANSI solution for this
> > situation?
> >
> > Thanks.
>
Received on Mon Jan 15 2001 - 04:15:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US