madcorp / zfdatagrid

Automatically exported from code.google.com/p/zfdatagrid
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Where vs Having on searches #865

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I have one zend db select query attached to grid.

The select has a group by statement and of course, some group related fields.

Sample of such field.

GROUP_CONCAT(DISTINCT method) AS `requestsTypes`

When from interface I am searching for one possible value as POST I am getting 
a SQL error.

Why? Because the search is done by adding a WHERE GROUP_CONCAT(DISTINCT method) 
LIKE '%POST%'

and not a HAVING requestsTypes LIKE '%POST%'

Any idea how to fix this issue?

Original issue reported on code.google.com by cbic...@gmail.com on 31 May 2012 at 12:03

GoogleCodeExporter commented 9 years ago
And btw, I think the Where/Having query should use the field alias in 
expression. Not to compute again the same thing.

Original comment by cbic...@gmail.com on 31 May 2012 at 12:28

GoogleCodeExporter commented 9 years ago
having query can't use alias in expression because it does not work in 
postgresql

Original comment by marek.vi...@gmail.com on 11 Sep 2012 at 6:15