My query is as below
Cursor c=mydatabase.rawQuery("SELECT DISTINCT name, MAX(user_score) AS max_score
FROM "+TableName+"
WHERE user_score IS NOT NULL
GROUP BY name
ORDER BY max_score
DESC LIMIT 5",
null);
i want to show only the top five of the scorers. All the other things in my code are working fine and if run simple Select * from tablename it working fine and give the results.
Help me and give me the solution where i am wronge and is there any syntex problem in sqllite or anything else ?
Please anyone help me.
You’re missing a space between the table name and
WHERE, otherwise the syntax looks correct.