The only way I can think of is to add a column, say "GroupPos", populate it,
and query where GroupPos <= 3.  If your table is large you can populate it
quickly be writing a short MabBasic application.  I'd be glad to help with
this if you need.

Michael Hanna

-----Original Message-----
From: Ron Gutiw [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 11:02 AM
To: MapInfo-L (E-mail)
Subject: MI-L SQL Query Question


Listers:

Is there any way to select the first 3 records from each group in a query?
ie:  
  select * from street_table where ??????? group by address
results:
  address1  col1 col2 col3 1
  address1  col1 col2 col3 2
  address1  col1 col2 col3 3
  address2  col1 col2 col3 1
  address2  col1 col2 col3 2
  address2  col1 col2 col3 3
  . . . 
  addressx  col1 col2 col3 1
  addressx  col1 col2 col3 2
  addressx  col1 col2 col3 3

Thanks
Ron


 
 
 
 

 

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to