Hello!
No, they do not get the same thing. SUM and GROUP BY must produce sums for
each unique value of the GROUP BY field(s), when simple SUM without GROUP BY
produces single row with sum of all records satisfying the criteria.
Regarding original posting - looks like a bug in MI 6.0. There should not be
requirements
that field(s) appearing in GROUP BY/ORDER BY must be selected. Thanks for pointing
on this.
Dmitry Bogdanov
GIS Department Manager
Kiev Software Factory Ltd.
room 46 9/12 Baumana St, Kiev, Ukraine 03190
Tel: (380 44) 442-6077; (380 44) 443-7925
Fax: (380 44) 443-7925
Internet: http://www.ksf.kiev.ua
-----Original Message-----
From: Bill Thoen <[EMAIL PROTECTED]>
>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]