Welcome Guest, Not a member yet? Register   Sign In
Query not following rules!!
#19

[eluser]TWP Marketing[/eluser]
Quote:RE using HAVING instead of WHERE. If it works, go with it, although it would be nice to know why WHERE doesn't work here...

Yep, I agree. Knowing why this is happening would be great.

Maybe this kind of explains it
http://stackoverflow.com/questions/31597...-of-having

As I read that stackoverflow thread, it looks like HAVING was put in as kludge to make something work. It can apparently be used with WHERE in the same statement but the scope is narrow. I"m out of my depth here, as I seldom use statements that complex.
There was a further link:

http://blog.sqlauthority.com/2007/07/04/...re-clause/
which give more detail about HAVING vs WHERE:

Quote:Answer in one line is : HAVING specifies a search condition for a group or an aggregate function used in SELECT statement.

HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause.

Which is why HAVING is working here, but doesn't explain why WHERE fails with OR_LIKE. I have no proof, but it may be that CI's implementation is at fault (grasping for straws here).


Messages In This Thread
Query not following rules!! - by El Forum - 09-07-2012, 01:27 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:30 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:33 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:45 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:49 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:04 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:10 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:23 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:29 PM
Query not following rules!! - by El Forum - 09-07-2012, 05:00 PM
Query not following rules!! - by El Forum - 09-10-2012, 06:27 AM
Query not following rules!! - by El Forum - 09-10-2012, 07:17 AM
Query not following rules!! - by El Forum - 09-10-2012, 07:44 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:07 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:15 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:38 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:51 AM
Query not following rules!! - by El Forum - 09-10-2012, 09:14 AM
Query not following rules!! - by El Forum - 09-10-2012, 09:36 AM
Query not following rules!! - by El Forum - 09-10-2012, 11:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB