0

I am running below code from the SQLite documentation on SQLiteStudio 3.3.3 :

SELECT a, b, group_concat(b, '.') OVER (
  ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING
) AS group_concat FROM t1;

Where t1 is defined as :

CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
INSERT INTO t1 VALUES   (1, 'A', 'one'  ),
                        (2, 'B', 'two'  ),
                        (3, 'C', 'three'),
                        (4, 'D', 'one'  ),
                        (5, 'E', 'two'  ),
                        (6, 'F', 'three'),
                        (7, 'G', 'one'  );

Instead of getting the expected result as shown in the SQLite documentation I get :

a b group_concat
1 A B
2 B C
3 C D
4 D E
5 E F
6 F G
7 G

How is this possible? Does this happen because I am using SQLiteStudio instead of SQLite? If this is the case, what are the rules for the frame definition of window functions in SQLiteStudio?

user4157124
  • 2,809
  • 13
  • 27
  • 42
  • No, this is not possible. The documentation is correct. – forpas Sep 29 '22 at 16:17
  • Well, the docs are correct, but I get the same in SQLiteStudio. Weird. DB Browser for SQLite produces correct result. Both report SQLite 3.35.5. – PChemGuy Sep 29 '22 at 16:29
  • It was a bug in SQLiteStudio 3.3.x. The upcoming version 3.4.0 has this fixed (you can download weekly build from GitHub Actions, if you have GitHub account). – Googie Oct 01 '22 at 19:49

0 Answers0