当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Is this way of fetching data from sqlite correct?

问题描述:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: