It's not really possible to use GROUP BY
with a ContentResolver
query. There used to be some parenthesis injection tricks to place the GROUP BY
in a syntactically correct place but that doesn't work on all platform versions.
Also, you can use ?
placeholder for literals only, not for identifiers such as column names.
Consider another approach to get the data you need in a way you want.