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

Home -> Community -> Usenet -> c.d.o.server -> Re: Is this possible in oracle

Re: Is this possible in oracle

From: Hexathioorthooxalate <ruler_at_removemetoemail.clara.co.uk>
Date: Sun, 27 Mar 2005 15:35:11 +0100
Message-ID: <1111934106.15686.0@eunomia.uk.clara.net>


<nekkalapudi.siva_at_gmail.com> wrote in message news:1111931807.567496.56600_at_f14g2000cwb.googlegroups.com...
>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
>

Other than performing two different queries, you can stay with a UNION of some sort. To retrieve T1 and T2, T1 data first try

select t1.*,1 as ord
 from t1
union all
select t2.*,2 as ord
 from t2
order by ord asc

Regards
Hex

Disclaimer:
If I am posting a question in a newsgroup:

   Please don't bother to reply with RTFM, this is trivial,    this is a waste of bandwidth, redesign your problem and    I might help you, this was posted last week etc. I    don't find this helpful and it also leads others    reading the current newsgroup thread to believe my    post has been answered when it has not. If what I am    saying is trivial etc, if possible please provide a URL    for others with similar problems to follow, or alternatively    if relevant give a code or pseudocode example. Remember    an expert was once too a novice, I am posting for help    because perhaps this isn't my field of expertise, or    maybe it even is and I things have become clouded, or    maybe I even need help from someone with greater knowledge.

If I am replying to an existing post in a newsgroup:

   Please note the posting is provided in good faith    by an IT professional in his own time from home. I have    good general knowledge of various technologies and    considerable expertise in others. Assistance given is    my personal view and any technical implementation relates    to my interpretation, expertise, and the current discussion    thread. My opinions are my own and does not reflect on any    employer or inside knowledge of a specific organisation. Any    information provided is provided "as is" with no warranty    implied nor liability accepted.

I will not respond to flaming, unnecessarily terse, or ad hominen attacks. If possible please direct all questions in the newsgroup for others to benefit. In the event you wish to contact me privately and directly, remove the obvious part from my e-mail address. In the event I choose to disclose my "real name" to you (other than my nom de plume "Hexathioorthooxalate"), please treat this information as confidential and unless explicitly authorised in writing, not disclose this information to others. Received on Sun Mar 27 2005 - 08:35:11 CST

Original text of this message

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