summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-07-20 14:51:52 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2002-07-20 14:51:52 +0300
commit907c668729b279c480f028d795b55b761b3aff33 (patch)
tree59a3e303f4dceb2b56763aee0bf50408cb5c153e /mysql-test/t/olap.test
parent4ce602e619d92c697e4a43f38f582c7fe1a9ad2f (diff)
downloadmariadb-git-907c668729b279c480f028d795b55b761b3aff33.tar.gz
OLAP functionality plus some small bug fixes
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r--mysql-test/t/olap.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
new file mode 100644
index 00000000000..b91bf2fb193
--- /dev/null
+++ b/mysql-test/t/olap.test
@@ -0,0 +1,22 @@
+drop table if exists sales;
+create table sales ( product varchar(32), country varchar(32), year int, profit int);
+insert into sales values ( 'Computer', 'India',2000, 1200),
+( 'TV', 'United States', 1999, 150),
+( 'Calculator', 'United States', 1999,50),
+( 'Computer', 'United States', 1999,1500),
+( 'Computer', 'United States', 2000,1500),
+( 'TV', 'United States', 2000, 150),
+( 'TV', 'India', 2000, 100),
+( 'TV', 'India', 2000, 100),
+( 'Calculator', 'United States', 2000,75),
+( 'Calculator', 'India', 2000,75),
+( 'TV', 'India', 1999, 100),
+( 'Computer', 'India', 1999,1200),
+( 'Computer', 'United States', 2000,1500),
+( 'Calculator', 'United States', 2000,75);
+select product, country , year, sum(profit) from sales group by product, country, year with cube;
+explain select product, country , year, sum(profit) from sales group by product, country, year with cube;
+select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+explain select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+select product, country , year, sum(profit) from sales group by product, country, year with cube union all select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+drop table sales;