Welcome Guest, Not a member yet? Register   Sign In
Active Record Subqueries?
#1

[eluser]darkhouse[/eluser]
I can't see a way, and I'm betting it's not possible, to do a subquery using the active record functions, aside from just doing this:

Code:
$this->db->query("SELECT COUNT(*) AS total_count FROM (SELECT MAX(last_updated) FROM table) AS counter");

I was hoping to be able to use things like $this->db->where(), etc, as I have some conditions I need to check that will affect how I write the SQL.

Any suggestions, or should I just build my SQL string and use the query method?


Messages In This Thread
Active Record Subqueries? - by El Forum - 01-21-2009, 12:12 PM
Active Record Subqueries? - by El Forum - 01-21-2009, 12:20 PM
Active Record Subqueries? - by El Forum - 01-21-2009, 02:51 PM
Active Record Subqueries? - by El Forum - 01-30-2009, 07:39 AM
Active Record Subqueries? - by El Forum - 01-30-2009, 05:11 PM
Active Record Subqueries? - by El Forum - 01-30-2009, 07:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB