MySQL's order by and limit offset a problem, take it out and everybody study under

Source: Internet
Author: User

Today comes a very weird question, title about MySQL's order by statement and the limit offset statement.

Under Bug reproduction: SELECT *

From a A

where A.culomn1

Limit 5 Offset 0

ORDER BY a.culomn1 ASC

The SqlException appears, prompting the order by this line to have a problem.

To change the statement to the following, swap the limit statement with the ORDER BY statement:

SELECT *

From a A

where A.culomn1

ORDER BY a.culomn1 ASC

Limit 5 Offset 0

will be normal execution, I do not know very little about SQL, so take out to learn, but also hope that everyone's generous enlighten.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.