android - Doing math calculations in a SQLite where clause -


with android's sqlite, possible math calculations on column values in clause? example, want select rows have values in column named mcolumnname. following approach didn't work me.

query(mtable, mcolumns, mcolumnname+"%2=?", new string[]{"0"}, null, null, null, null) 

is there way achieve this?

android binds query arguments strings, produces bugs when using functions , operations produce numeric results. inlining 0 in selection string should fix this:

query(mtable, mcolumns, mcolumnname + " % 2 = 0", null, null, null, null, null) 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -