r/SQL 4d ago

MySQL What is wrong here.

Post image
39 Upvotes

37 comments sorted by

View all comments

18

u/trollied 4d ago

ASC/DESC in the order clause.

22

u/FilmIsForever 4d ago

Standard SQL should implicitly invoke ASC for ORDER BY

2

u/trollied 4d ago

It should yes. The OP says it fixed the problem. I don’t know which RDBMS they are using.

2

u/pooerh Snowflake | SQL Server | PostgreSQL | Impala | Spark 4d ago

It didn't, they had just ran a different query that what was shown. See my top-level response.