Hello, I’m working on an app and have to sum up the
one of the columns in the database.
Surely I make a mistake, but I can not handle myself, so please for your help.
In the console returns nil, and there are values (digits) in the database column.
Please give advice on how to sum the column values in the database.
Excuse me for my bad English.
1. local sumata 2. local obCena\_sum 3. 4. local path = system.pathForFile( "mydatabase.db", system.DocumentsDirectory ) 5. 6. local db = sqlite3.open( path ) 7. 8. local sumata = [[SELECT SUM ( obCena) FROM accounts AS obCena\_sum]] 9. 10. db:exec( sumata ) 11. 12. print( obCena\_sum )