SQLite Forum

Sir Richard

Sir Richard

(1) By anonymous on 2021-11-23 19:27:08 [link] [source]

Small documentation issue, visible in web documentation for SQL Language Expressions as of 23 November 2021:
In both (a) the syntax diagram for expressions, and (b) the list of Operators, it seems that the use of 'IS NULL' (two separate words) is not permitted.
But I know it is in fact permitted.
If it were just in the syntax diagram I would think that I had failed to understand it somehow, but the list of Operators makes very clear the contrast between the two forms allowed for 'not null' and the one form allowed for 'null'.

(2) By Larry Brasfield (larrybr) on 2021-11-23 19:43:40 in reply to 1 [link] [source]

Please try to use thread titles which reflect the topic they introduce.

Both the expression syntax diagram and the operator table show IS in the role of a binary operator. Hence, taking those data as enabling, <expr> IS NULL clearly is permitted because NULL itself is an expression.

(3) By Richard Damon (RichardDamon) on 2021-11-23 19:47:43 in reply to 1 [source]

'expr IS NULL' is just a special case of 'expr IS expr', since 'expr' includes as an option a 'literal-value', and one of the options for 'literal-value' is 'NULL'

The fact that there is also a different option of ISNULL is immaterial. That couldn't be decomposed into a more general case.