问题描述:

I am using this query to fetch data from sqlite but only one condition is working but not two at same time.

I am also getting some notification that no such column but it exist.

String lquery = "SELECT SUM(totalcalorie) AS LTotal FROM fooditem

WHERE name = ('" + fname + "') AND foodtype = 'Lunch'";

网友答案:

you might be having null values on those places which you are checking while calling..

go through your code again queries seems write.

网友答案:

change totalcalorie to INTEGER type in the database schema

comment says that you are using TEXT

相关阅读:
Top