Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is this possible in oracle
nekkalapudi.siva_at_gmail.com wrote:
> I have the following query
>
> SELECT t1.*
> FROM t1
> UNION ALL
> SELECT t2.*
> FROM t2
>
> Now the question is can we display T1 data first and then T2 data
next
> with out using UNION ALL
Yes:
SELECT t1.*, 'T1' as t1
FROM t1
UNION ALL
SELECT t2.*, 'T2' as t1
FROM t2;
Thsi shuold place data from table t1 before data from t2, along with a 'tag' to identify the data source. You can also suppress the tag by:
column t1 noprint
which should continue to output the data in table order, data from t1 before data from t2. The question I ask now is 'Why do you 'need' such functionality?' Or is this an exercise proving the knowledge level of the newsgroup?
David Fitzjarrell Received on Sun Mar 27 2005 - 08:21:45 CST
![]() |
![]() |