I think Bill and Sami have given you some tips, but when I started foolin' around w/GROUP BY, Etc., I found a couple of old RBEXCHANGE articles helpful.  They are/should be part of your install.  Try :
 
START|PROGRAMS|YOUR_RB_MENU_OPTION|RBASE Legacy Documents
 
then, take a look at these articles :
 
823,824,825,841,838,791,720
 
Not all of these are exclusively about GROUP BY, but each one has something in it that has helped me, either w/GROUP BY or w/sub-SELECT's.  Hope you find something useful therein as well.
 
Later,
Steve in Memphis
----- Original Message -----
Sent: Tuesday, December 10, 2002 11:22 AM
Subject: RE: More from select distinct than I can probably expect but here goes:

I am scratching my head on this Select Distinct problem.
More from select distinct than I can probably expect but here goes:

Date looks like: (partial data, thousands of rows) (TABLE NAME :RIDES)

RiderNum        Fname   Lname       RideMiles              RideDate     GroupNumber
------------    -----------     --------------------    --------------  ----------------        
          1     Brian   Mowers          30.             10/21/2002      8
          1     Brian   Mowers          32.             11/24/2002      8
          2     Cathy   Mowers          30.             10/21/2002      8
          2     Cathy   Mowers          32.             11/24/2002      8
          8     Gunthe  Heurl           30.             10/21/2002      8
          8     Gunthe  Heurl           32.             11/24/2002      8
          9     Barb    Underwood       30.             10/21/2002      8
          9     Barb    Underwood       32.             11/24/2002      8
         22     Robert  Redford         30.             10/21/2002      8
         22     Robert  Redford         32.             11/24/2002      8
         41     Roger   Faber           30.             10/21/2002      8
         41     Roger   Faber           32.             11/24/2002      8
         48     Terrie  Faber           30.             10/21/2002        8
         48     Terrie  Faber           32.             11/24/2002        8

Want distinct Fname,Lname From Rides Where GroupNumber=8
 However, I want to include the RideMiles as part of this select.
If I put the RideMiles into the select (below) it breaks the discinctness that I am looking for. Is this possible?

This is what I want:
RiderNum        Fname   Lname           RideMiles       
--------------- ----------- ------------        --------------  
          1     Brian   Mowers          32.             
          2     Cathy   Mowers          32.             
          8     Gunthe  Heurl           32.             
          9     Barb    Underwood       32.             
         22     Robert  Redford         32.             
         41     Roger   Faber           32.             
         48     Terrie  Faber           32.             
Any insight appreciated.
Thanks,
Brian Mowers



Reply via email to