LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


Back to: Top of message | Previous page | Main SAS-L page