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:

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

and your problem could have resolved.

Hope this works.

Uncategorised

Leave a Reply

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