Welcome Guest, Not a member yet? Register   Sign In
Datamapper Sub queries wrapped in a function
#2

[eluser]drakeonfire[/eluser]
I've found a solution. After reading the documentation more thoroughly I decided to just do something like this:

Code:
select_func('COALESCE', '[(SELECT AVG(`rating`) FROM `ratings` WHERE `ratings`.`product_id` = `products`.`id`)]', 'avg_rating')



Messages In This Thread
Datamapper Sub queries wrapped in a function - by El Forum - 10-27-2012, 04:15 AM
Datamapper Sub queries wrapped in a function - by El Forum - 10-27-2012, 04:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB