summaryrefslogtreecommitdiff
path: root/mysql-test/r/derived.result
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-03-16 17:35:49 +0200
committerbell@sanja.is.com.ua <>2004-03-16 17:35:49 +0200
commitc9938b9dff045915bee6f672bb7306a2da8a9b8a (patch)
tree2df566fe70f19f7a99dd06d250c5fce2e4a6a5bd /mysql-test/r/derived.result
parente970ff9e87ab1b9eb6e66f9deff9522ac6af3fdf (diff)
parent7593d8a0563d44e44f85bef6aa0487499d782481 (diff)
downloadmariadb-git-c9938b9dff045915bee6f672bb7306a2da8a9b8a.tar.gz
merge
Diffstat (limited to 'mysql-test/r/derived.result')
-rw-r--r--mysql-test/r/derived.result6
1 files changed, 6 insertions, 0 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index be743be386b..7e5c519e108 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -320,3 +320,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
2 DERIVED t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
drop table t2;
+CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`));
+insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10);
+SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices;
+min max avg
+10.00 10.00 10
+DROP TABLE t1;