In mysql using cast, I wrote the query like
Accnno - varchar
SELECT * FROM books where category = 'Book' ORDER BY CAST(Accnno AS int) DESC LIMIT 0,10
The above query is working fine in the localhost, But is not working in the server, It shows error like
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 'int) DESC LIMIT 0,10' at line 1