Maybe this is a simple problem, but I am just not seeing it 🙂
In my database, I have two fields named NoRide and NoAttempt.
In one row I have NoRide = 40 and NoAttempt = 40.
I have no issues when I query directly in the database using:
SELECT * FROM MyTable WHERE NoRide = NoAttempt
However in Android, I wrap this exact line in a rawQuery statement, and I get no results. Similarly if I do things like
rawQuery(“SELECT * FROM MyTable WHERE NoRide – NoAttempt != ‘0’”, null);
I also get no data, when this query works fine in the database query.
Is there something different with rawQuery in android that I am missing?
I don’t know what’s happening with the first part of your question (NoRide=NoAttempt), but I have an idea about the second issue.
Try removing the single quote from the 0… the database probably thinks you’re trying to compare an int to a string. Lise so: