Skip to content Skip to sidebar Skip to footer

How To Get The Row# Nearest To Current Time In Sqlite For Android Rawquery

Experts, I would like to get the value from column MyColumn, where column Judge is true, and column DateTime is closest to current time. How to approach this? Thanks. I develop cod

Solution 1:

When you use an aggregation function like MIN() without GROUP BY, you get a result over all rows, even if there are none.

Just add GROUP BY Judge.

(And you must no try to read from the cursor before you have checked for a valid row.)

Post a Comment for "How To Get The Row# Nearest To Current Time In Sqlite For Android Rawquery"