Date: Thu, 10 Apr 2003 15:25:18 -0700
Reply-To: "Huang, Ya" <yhuang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <yhuang@AMYLIN.COM>
Subject: proc sql, outer union and order by
Content-Type: text/plain; charset="iso-8859-1"
Hi there,
I wonder if there is any way that I can apply "order by"
to one set of the outer union, in stead of all the query
result by default?
data xx;
input a b;
cards;
1 2
9 4
3 0
;
options nocenter;
proc sql;
select *
from xx
outer union corr
select *
from xx
;
--------
Result:
a b
------------------
1 2
9 4
3 0
1 2
9 4
3 0
Result I want:
a b
------------------
1 2
3 0
9 4
1 2
9 4
3 0
In other word, I want the first set ordered by a,
but keep the second set order untouched.
This won't work:
proc sql;
select *
from xx
order by a /*****/
outer union corr
select *
from xx
;
Any comments?
Thanks
Ya Huang
|