| Bug #48762 | Having clause does not limit resultset correctly without group by being used | ||
|---|---|---|---|
| Submitted: | 13 Nov 2009 14:46 | Modified: | 13 Dec 2009 15:41 |
| Reporter: | Corey Tisdale | Email Updates: | |
| Status: | No Feedback | Impact on me: | |
| Category: | MySQL Server: General | Severity: | S2 (Serious) |
| Version: | 5.1.40 | OS: | Any (Tested on OSx and Vista64) |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | having clause, improper return | ||
[13 Nov 2009 14:46]
Corey Tisdale
[13 Nov 2009 15:41]
Valeriy Kravchuk
Sorry, but why don't you use WHERE to filter rows and use HAVING instead? Please, read the manuam, http://dev.mysql.com/doc/refman/5.1/en/group-by-hidden-columns.html: "The SQL standard does not allow the HAVING clause to name any column that is not found in the GROUP BY clause if it is not enclosed in an aggregate function. MySQL allows the use of such columns to simplify calculations. This extension assumes that the nongrouped columns will have the same group-wise values. Otherwise, the result is indeterminate." So, are you sure that all columns have the same value in your single group (and, without GROUP BY, any result set is considered a single group...)?
[14 Dec 2009 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
