summaryrefslogtreecommitdiff
path: root/src/test/suite/group_err.sql
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-07-09 06:22:35 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-07-09 06:22:35 +0000
commitd31084e9d1118b25fd16580d9d8c2924b5740dff (patch)
tree3179e66307d54df9c7b966543550e601eb55e668 /src/test/suite/group_err.sql
downloadpostgresql-d31084e9d1118b25fd16580d9d8c2924b5740dff.tar.gz
Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01
Diffstat (limited to 'src/test/suite/group_err.sql')
-rw-r--r--src/test/suite/group_err.sql29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/suite/group_err.sql b/src/test/suite/group_err.sql
new file mode 100644
index 0000000000..36600ce1f8
--- /dev/null
+++ b/src/test/suite/group_err.sql
@@ -0,0 +1,29 @@
+---------------------------------------------------------------------------
+--
+-- group_err.sql-
+-- test illegal use of GROUP BY (with aggregates)
+--
+--
+-- Copyright (c) 1994-5, Regents of the University of California
+--
+-- $Id: group_err.sql,v 1.1.1.1 1996/07/09 06:22:30 scrappy Exp $
+--
+---------------------------------------------------------------------------
+
+create table G_ERR (x int4, y int4, z int4);
+
+select x from G_ERR group by y;
+select x, sum(z) from G_ERR group by y;
+select x, count(x) from G_ERR;
+
+select max(count(x)) from G_ERR;
+
+select x from G_ERR where count(x) = 1;
+
+create table H_ERR (a int4, b int4);
+
+select y, a, count(y), sum(b)
+from G_ERR, H_ERR
+where G_ERR.y = H_ERR.a group by y;
+
+drop table G_ERR, H_ERR;