Commit ab8904c 1 parent a1cba4e commit ab8904c Copy full SHA for ab8904c
File tree 3 files changed +14
-2
lines changed
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ SELECT a.i as j FROM tst a GROUP BY a.i;
168
168
---
169
169
(0 rows)
170
170
171
+ SELECT a.i as j FROM tst a GROUP BY a.i HAVING a.i = a.i;
172
+ j
173
+ ---
174
+ (0 rows)
175
+
171
176
DROP GRAPH new_cypher CASCADE;
172
177
NOTICE: drop cascades to 2 other objects
173
178
DETAIL: drop cascades to table new_cypher._ag_label_vertex
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ SELECT a.* FROM tst as a;
85
85
86
86
SELECT a .i as j FROM tst a GROUP BY a .i ;
87
87
88
+ SELECT a .i as j FROM tst a GROUP BY a .i HAVING a .i = a .i ;
88
89
89
90
DROP GRAPH new_cypher CASCADE;
90
91
DROP GRAPH new_cypher_2 CASCADE;
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ typedef struct GroupClause
144
144
145
145
%type <node> where_clause
146
146
a_expr b_expr c_expr indirection_el
147
- columnref
147
+ columnref having_clause
148
148
149
149
%type <integer> set_quantifier
150
150
%type <target> target_el
@@ -530,7 +530,7 @@ simple_select:
530
530
SELECT opt_all_clause opt_target_list
531
531
//into_clause
532
532
from_clause where_clause group_clause
533
- group_clause // having_clause window_clause
533
+ group_clause having_clause // window_clause
534
534
{
535
535
SelectStmt *n = makeNode(SelectStmt);
536
536
/* n->targetList = $3;
@@ -1295,6 +1295,12 @@ empty_grouping_set:
1295
1295
}
1296
1296
;
1297
1297
1298
+ having_clause :
1299
+ HAVING a_expr { $$ = $2 ; }
1300
+ | /* EMPTY*/ { $$ = NULL ; }
1301
+ ;
1302
+
1303
+
1298
1304
return :
1299
1305
RETURN DISTINCT return_item_list group_by_opt having_opt window_clause order_by_opt skip_opt limit_opt
1300
1306
{
You can’t perform that action at this time.
0 commit comments