Hi,

        I have been doing a Union query and would like to obtain distinct 
results.
Via the manual, the correct way to accomplish this is to do a UNION statement 
(versus 
doing a UNION ALL).

        Problem: I want the order of the select statements left intact after 
the UNION 
select statements.

        Example: I have some records like this ->

                FName   LName   Side    Height
                ------------------------------
                Momma   Joe     A       1
                Gnu     Org     A       3
                Daddy   Kane    B       2
                Joe     Diddy   B       4

        So, when I combine a compount select statement with a UNION, I want the 
height to increase 
in ascending order, but, I ALSO want the side column to alternate between A and 
B.  If 
I do the UNION ALL I'll get something like ->

                FName   LName   Side    Height
                ------------------------------
                Momma   Joe     A       1
                Joe     Diddy   B       4
                Gnu     Org     A       3
                Joe     Diddy   B       4
                Gnu     Org     A       3
                Daddy   Kane    B       2

                See the duplicates (I'm disregarding the ascending height for 
this part)?  
If I do the UNION I get this ->

                FName   LName   Side    Height
                ------------------------------
                Gnu     Org     A       3
                Joe     Diddy   B       4
                Momma   Joe     A       1
                Daddy   Kane    B       2

                See how the heights are all off (disregarding the alternating 
sides in this 
part)?  How should I write this thing so that I get the ascending height ALONG 
WITH the alternating
sides according to the order of the select statements that I put in the query?  
Thanks.
        
-- 
VR~
        TW
        Email: [EMAIL PROTECTED]
        "Knowledge Is Power"
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to