"Group by" will ensure that the records in the result are, in fact, grouped
by the selected column.
"Order by" will ensure that the result is in order.
Without the order by, I might get
len code
15.1 AB
9.2 GL
13.2 CC
With the order by, I would get
len code
15.1 AB
13.2 CC
9.2 GL
Actually, this was just a demonstration of a syntax that used to work, but
doesn't now.
I believe that if the field occurs in either 'group by' or 'order by' you
must include
it in the list of selected fields. You didn't have to do that with 5.5 or
earlier.
-----------------------------------------
Daniel J. Bower
Commuter Services Director
intelitran
2000 Oxford Drive, Suite 400
Bethel Park, PA 15102
(412) 854-6940
fax: (412) 854-6941
[EMAIL PROTECTED]
-----Original Message-----
From: Bill Thoen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 27, 2000 3:11 PM
To: Bower, Daniel J
Cc: MapInfo-l (E-mail)
Subject: Re: MI Change in Select Statement
Your SQL syntax seems a bit wierd. Why do you need 'group by' and
'order by' anyway? Doesn't this get you the same thing?
Select Sum(ObjectLen( obj, "mi" )) from MyTable
where CodeField = "MyCode" and Str$(obj) =
"Polyline"
Into MySelection
- Bill Thoen
"Bower, Daniel J" wrote:
>
> The following worked under MI 5.5 and earlier, but causes an error in MI
> 6.0:
>
> Select Sum(ObjectLen( obj, "mi" )) from MyTable
> where CodeField = "MyCode" and Str$(obj) = "Polyline"
> Into MySelection Group by CodeField Order by CodeField
>
> "CodeField" is a field in MyTable. Previously, you could order and/or
group
> by fields that were not in the selection. Now these fields have to be in
> the list of selected fields, e.g.,
>
> Select Sum(ObjectLen( obj, "mi" )), CodeField from MyTable
> where CodeField = "MyCode" and Str$(obj) = "Polyline"
> Into MySelection Group by CodeField Order by CodeField
>
> Guess I'll have to look at all of my MapBasic code and try to find all the
> places where I've done this....
>
> -----------------------------------------
> Daniel J. Bower
> Commuter Services Director
> intelitran
>
> ----------------------------------------------------------------------
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]