Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
TDBISAMQuery.MaxRowCount and GROUP BY |
Wed, Jan 21 2015 7:48 AM | Permanent Link |
Markus Gnam | Hi,
I used to use TDBISAMQuery.MaxRowCount set to 300.000 because I assumed there were no interferences with GROUP BY. From the documentation: "This property does not respect any DISTINCT, GROUP BY, or ORDER BY clauses in the SQL Statement." However, using the following query I received wrong results (too few records were counted): SELECT COUNT(*), Corrector FROM trkid WHERE AssignDate IS NOT NULL GROUP BY Corrector I've reset now to MaxRowCount = -1, because then I get correct results. However, I'd like to ask if this is the expected behaviour? Thank you very much! Markus |
Wed, Jan 21 2015 8:24 AM | Permanent Link |
Raul Team Elevate | <<
Markus Gnam wrote: I used to use TDBISAMQuery.MaxRowCount set to 300.000 because I assumed there were no interferences with GROUP BY. From the documentation: "This property does not respect any DISTINCT, GROUP BY, or ORDER BY clauses in the SQL Statement." However, using the following query I received wrong results (too few records were counted): SELECT COUNT(*), Corrector FROM trkid WHERE AssignDate IS NOT NULL GROUP BY Corrector I've reset now to MaxRowCount = -1, because then I get correct results. However, I'd like to ask if this is the expected behaviour? >> I have not used this myself but my interpretation of "does not respect GROUP BY" is that it will first apply the MaxRowCount and then other operations like group by. Hence the select will first limit itself to 300.000 records and only then apply group by thus working on subset of data. IMHO behavior is as documented and expected. Raul |
Thu, Jan 22 2015 5:36 AM | Permanent Link |
Markus Gnam | Raul wrote:
<< I have not used this myself but my interpretation of "does not respect GROUP BY" is that it will first apply the MaxRowCount and then other operations like group by. Hence the select will first limit itself to 300.000 records and only then apply group by thus working on subset of data. IMHO behavior is as documented and expected. Raul >> Hi Raul, thank you! You are right, my main misunderstanding was that I assumed MaxRowCount would apply to the number of rows returned in the result set and not necessarily to the number of rows retrieved by the Select statement. Best wishes, Markus |
This web page was last updated on Wednesday, May 15, 2024 at 08:40 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |