Hello,
I'm having problems with getting a value from a single column call.
select sum(price) as testPrice from sales where quantity > 10
but when I inspect the resultset, I get the following,
[#"5"}>]
Any help is appreciated, thank you.
Hello,
I'm having problems with getting a value from a single column call.
select sum(price) as testPrice from sales where quantity > 10
but when I inspect the resultset, I get the following,
[#"5"}>]
Any help is appreciated, thank you.
That is a very strange result. I am curious why you are not writing the query using ActiveRecord methods:
@testPrice = Sale.sum(:price, :conditions => "quantity > 10")