Hi I have a table with item and price as shown below
item price
ABC 5.0
DEF 6.0
and I am trying to execute it with the following query.
select sum(sign(price)*ceiling(abs(price))) as price, item from product
Now when I execute this query staight away in the following way it works shows total as 11.0 in output for both item
statement.exectuteQuery("select sum(sign(price)*ceiling(abs(price))) as price, item from product")
But when I put query in string strangely it does not work and it gives null as output in price column
String qry = "select sum(sign(price)*ceiling(abs(price))) as price, item from product";
statement.exectuteQuery(qry);
Please guide. Thanks in advance.