I need to order my data by the latest date.
This SQL statment is working
final String selectSql = "select * from questionnaire where userprofileid=" + userProfileID ;
This SQL statment is ** NOT working**
final String selectSql = "select * from questionnaire where userprofileid=" + userProfileID +"ORDER by datecreated desc";
Error Message:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘by datecreated desc’ at line 1
You need to add a space before ORDER: