SQLite Forum

operator precedence docs missing, suggested clarifications below
Please bear with me as I try to formulate an argument for changing that doc to improve ease of comprehension (by adding or changing something) without degrading comprehension via needless volume increase. I already have the argument against: It is unclear, as of yet, that some sort of unified precedence chart would make it easier for SQL writers to know what their SQL will mean.

It appears that we have gone from the assertion implicit in your thread title, "... docs missing ...", to the assertion that a unified (rather than separated) precedence chart would be easier to understand. Is that right? Does that satisfy your sense that too much reading was needed to find the (not really) "missing" precedence of BETWEEN (in Section 6) and COLLATE (in section 2)? In other words, is your contention simply that the statements about precedence should group together more?

I trust you see the pitfall of simply listing BETWEEN with the binary operators. It is not a binary operator, and if that operator list became "binary and trinary operators" it would then need a distinguishing attribute of some kind to avoid confusing people as to which were binary and which were trinary, (or would force them to look further for that information, just as they must now only for BETWEEN.)

There are a couple things which would make the case for a change:

1. One is a contrived but plausible SQL expression whose parse is ambiguous to a human reader, where reading enough of [the expression syntax/semantics page](https://sqlite.org/lang_expr.html) to disambiguate it is "hard".

2. The other is a suggested change which clearly resolves thing #1 (by being apparently less hard) and remains practically as clear as before for the ordinary unary and binary operators.

Do you want to propose something?