If I use the query to return some basic columns in table, that is OK. But if I use group by
, order by
, sum(column)
or choose specified columns, the query fails to run.
I use Cursor query method or rawquery, both the same. If I run the following queries in adb shell, it works without problems.
select * from table (work)
select fielda, fieldb from table (failed)
select fielda, sum(fieldb) from table group by fielda (failed)
The following queries work without problems.
select * from table where strftime('%m',field)='09'
select * from table where strftime('%Y',field)='2010'
Anyone knows what happened to these query to make them fail? Are there any rules I need to follow?