We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bee1387 commit 1b678d1Copy full SHA for 1b678d1
book/src/super-sql/declarations/pragmas.md
@@ -49,3 +49,37 @@ values {
49
{a:"a",b:error("missing")}
50
{a:[2],b:1}
51
```
52
+
53
+---
54
55
+_Use default `GROUP BY` precedence (no `pragma`) to group by the alias "x" that refers to constant 0_
56
57
+```mdtest-spq
58
+# spq
59
+SELECT 0 AS x, COUNT(*) AS n GROUP BY x
60
+# input
61
+{x:1}
62
+{x:2}
63
64
65
+# expected output
66
+{x:0,n:4}
67
+```
68
69
70
71
+_Use PostgreSQL `GROUP BY` precedence to group by the source column "x" (not the alias)_
72
73
74
75
+pragma pg = true
76
77
78
79
80
81
82
83
+{x:0,n:2}
84
85
0 commit comments