[odb-users] Native query error

Gunjur Munireddy Prashanth / LOKISA Smart Energy GmbH GPrashanth at prosolartec.de
Fri Sep 6 07:03:13 EDT 2013


Hello ,

I am using native sql query to get the average of a column and I get the average has  1.0000

Below is the snippet

float avg = db->execute("SELECT AVG(mod_il2) FROM OddDay");
syslog(LOG_NOTICE, "mod il1 avg = %.2f   ", avg);


in sysylog data  I get  mod il1 avg = 1.00

the below statement executes fine and I am able to delete all the data from the table
db->execute("DELETE FROM EvenDay");

Can anyone tell me what could be the possible mistake I might have done ??


Thanks!!


More information about the odb-users mailing list