FUNCTION FIELD does not exist – ORDER BY FIELD Error

While using ORDER BY Field function of MySQL, the following error occurred:

FUNCTION database_name.FIELD does not exist

Here’s a quick solution

FUNCTION FIELD does not exist

If you are using a query like below:

SELECT * FROM tbl ORDER BY FIELD (id,1,2,3);

then there’s a chance you may face this type of error while running the query.

Solution is simple. Remove the space between FIELD and round bracket (.

So the query should look like:


and your problem could have resolved.

Hope this works.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>