[mapguide-users] Use Group By or Distinct Query in MapGuide Application

HYS harryt.schimmel at gmail.com
Fri Jul 27 11:09:07 EDT 2007


In the documentation the following example is given:

Example
GroupName is a string property, and aDouble is a double property. Three
values are returned by this query. Each of them is the smallest aDouble
property value in one of the groups of features selected by the grouping
filter.

        <?php
        $stringCollection->Add("GroupName");
        $groupingFilter = "GroupName = 'Group1' or GroupName = 'Group2' or
GroupName = 'Group3'";
        $aggregateOptions->SetGroupingFilter($stringCollection,
$groupingFilter);
        $aggregateOptions->SetComputedProperty("minD", "min(aDouble)");
        $dataReader = $featureService->SelectAggregate($featureSrcResId,
$featClassName, $aggregateOptions);
        ?>
        sqlplus> select min(aDouble) as minD from featclass group by
groupname having groupname = 'Group1' or groupname = 'Group2' or groupname =
'Group3';

have a look in the program directory of the server
mgwebserverextensions/Help/modules.html


Dhirendra Kumar wrote:
> 
> Hi All,
> 
> In my SDF file's have some Duplicate rows and when i fetch data using
> query then it return all duplicate rows also, but i want to fetch only one
> copy of Duplicate rows. when i use distinct or group by clause then it is
> not working and not return proper result. So, is it possible to use Group
> By or Distinct clause with MGOS ?, If yes then how or any alternate way ?
> Pls help me. Thankyou in Advance.
> 
> 
> Regards,
> 
> Dhirendra Kumar
> 

-- 
View this message in context: http://www.nabble.com/Use-Group-By-or-Distinct-Query-in-MapGuide-Application-tf3678724s16610.html#a11831185
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list