03.12.2021, 08:06
Try this:
Code:
cur = dbcon:execute('SELECT COUNT(period) AS cnt FROM total_energy WHERE period = "day"')
row = cur:fetch({}, 'a')
cur:close()
count = tonumber(row.cnt)
log(count)