Active Record
ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From Rob Sanchez
query issue
General
interface
|
Posted: 11 February 2011 12:42 PM |
|
|
|
Hi Rob
I have set up this query and it is running just fine in sql manager and sequel pro:
SELECT SUM(field_id_2+field_id_3+field_id_4+field_id_5+field_id_6+field_id_7)/(6*(SELECT COUNT(entry_id) FROM exp_channel_titles WHERE channel_id="1" AND status="final")) FROM exp_channel_data WHERE entry_id IN (SELECT entry_id FROM exp_channel_titles WHERE status="final");
(its calculating the averages across entries of certain field_ids filtered by status and group_id)
For some reason it breaks in the native query module.
Would it be possible to convert this query in active record plugin?
Cheers
Christian
|
|
|
interface
|
Posted: 11 February 2011 03:23 PM |
# 1
|
|
|
Hi Rob
solved the issue.
Cheers
|
|
|
Rob Sanchez
|
Posted: 12 February 2011 02:32 PM |
# 2
|
|
Developer
|
Just a note for anyone else reading this thread: subqueries are not possible in CodeIgniter’s activve record class.
|
|
|