Matt Elhotiby
Matt Elhotiby

Reputation: 44066

MySQL: ERROR 1064 (42000) - Why is ORDER BY failing?

as a 
limit 0,50 
ORDER BY SortOrder, paid desc, ae desc, name asc, title asc

ERROR 1064 (42000): 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 'ORDER BY SortOrder, paid desc, ae desc, name asc, titile asc' at line 48

Upvotes: 0

Views: 2365

Answers (2)

Bobby
Bobby

Reputation: 11576

As far as I know, LIMIT needs to be at the end of the statement.

Upvotes: 5

mike
mike

Reputation: 5213

You have to change the order of the parts of your query. Change it to

as a ORDER BY SortOrder, paid desc, ae desc, name asc, title asc limit 0,50

Upvotes: 12

Related Questions