[eluser]Jon L[/eluser]
Currently AR does not support subqueries (you could have looked at the AR code to find that out), I have no clue if it will be supported in the future.
Regarding ANSI SQL, no clue.
Regarding DB Cache, I've never used that, as I've always found file caching to be ultimately slower than just querying the db, storing in a session, or storing in memory using something like Memcache (which is my current caching solution)
To find out what's wrong tho, do a var_dump() on the 2 values in your IF statement, replace the OR with a comma, and you should see which statement evaluates to false, which will point you towards what is breaking.