SQLite Forum

order of INSERT affects the output
Login
Hello everyone,

Consider the following example:

```SQL
CREATE TABLE t0(c0);
INSERT INTO t0 VALUES(-1);
INSERT INTO t0 VALUES('a');

SELECT COUNT(*) FROM t0 GROUP BY NULL HAVING c0;
```
The output of SQLite 3.35.4 is "2".

But when we change the order of the INSERT statements, just like:

```SQL
CREATE TABLE t0(c0);
INSERT INTO t0 VALUES('a');
INSERT INTO t0 VALUES(-1);

SELECT COUNT(*) FROM t0 GROUP BY NULL HAVING c0;
```

There will be no output.

I wonder whether it is a bug.

Looking forward to your early reply :)