SQLite Forum

DESC keyword is ignored
Login
From the docs:

"Each ORDER BY expression is processed as follows:

If the ORDER BY expression is a constant integer K then the expression is considered an alias for the K-th column of the result set (columns are numbered from left to right starting with 1).

If the ORDER BY expression is an identifier that corresponds to the alias of one of the output columns, then the expression is considered an alias for that column.

Otherwise, if the ORDER BY expression is any other expression, it is evaluated and the returned value used to order the output rows..."

and here:

"The SQL standard requires double-quotes around identifiers and single-quotes around string literals. ...  But, in an effort to be compatible with MySQL 3.x ... SQLite will also interpret a double-quotes string as string literal if it does not match any valid identifier.

This misfeature means that a misspelled double-quoted identifier will be interpreted as a string literal, rather than generating an error. It also lures developers who are new to the SQL language into the bad habit of using double-quoted string literals when they really need to learn to use the correct single-quoted string literal form."