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

Home -> Community -> Usenet -> c.d.o.tools -> Re: HOW TO INCLUDE THE SOURCE TABLE IN A QUERRY

Re: HOW TO INCLUDE THE SOURCE TABLE IN A QUERRY

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 14 Aug 2001 20:15:28 +0200
Message-ID: <997812931.5226.0.pluto.d4ee154e@news.demon.nl>

"Hagai Katz" <katzh_at_bgumail.bgu.ac.il> wrote in message news:9lb4vv$fre$1_at_news.huji.ac.il...
> Hi fellows,
> I want to unite data from two tables, like this:
> SELECT ID, LOCATION, DATA_TYPE FROM NIH1995
> UNION
> SELECT ID, LOCATION, DATA_TYPE FROM NIH1996;
> but want to know from which of the two tables came every row in the
 results.
> Any suggestions on how to do that?
> Thanks,
> Hagai.
>
>

1 Not posting to half Usenet
2 rewrite the query as

 SELECT 'NIH1995', ID, LOCATION, DATA_TYPE FROM NIH1995  UNION
 SELECT 'NIH1996', ID, LOCATION, DATA_TYPE FROM NIH1996; And that is ALL

Hth,

Sybrand Bakker, Senior Oracle DBA Received on Tue Aug 14 2001 - 13:15:28 CDT

Original text of this message

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