Reputation: 93
I'm try to execute this query but not working in sqlite android database
"select CLFPSid from CheckLists where CLFPid = "+ section + " and ActionDate ='"+Date+"'and CLFPSid = 0 or 3 or 4 or 5"
the problem in using OR statment , note that CLFPSid is of type integer .
how to use or sqlite condition statement ?
Upvotes: 0
Views: 67
Reputation: 35587
Change your query as follows
"select CLFPSid from CheckLists where CLFPid = "+ section + "
and ActionDate ='"+Date+"'and CLFPSid = 0 or CLFPSid = 3
or CLFPSid = 4 or CLFPSid = 5"
Upvotes: 1
Reputation: 10810
You can't write
CLFPSid = 0 or 3 or 4 or 5
You should use the IN clause:
CLFPSid IN (0, 3, 4, 5);
Upvotes: 3