summaryrefslogtreecommitdiff
path: root/mysql-test/r/derived.result
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-02-02 14:58:36 +0200
committerbell@sanja.is.com.ua <>2004-02-02 14:58:36 +0200
commit7593d8a0563d44e44f85bef6aa0487499d782481 (patch)
treee96c96e6e7e04c0e0502278b3eea5238b63d4af8 /mysql-test/r/derived.result
parent8a3e00a05b9f4f59fb4400487bd5dd6c13566832 (diff)
downloadmariadb-git-7593d8a0563d44e44f85bef6aa0487499d782481.tar.gz
fixed parsing mode for derived tables (BUG#2421)
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 170c393524b..481a2a5cd72 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -298,3 +298,9 @@ INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00
select 497, TMP.ID, NULL from (select 497 as ID, MAX(t3.DATA) as DATA from t1 join t2 on (t1.ObjectID = t2.ID) join t3 on (t1.ObjectID = t3.ID) group by t2.ParID order by DATA DESC) as TMP;
497 ID NULL
drop table t1, t2, t3;
+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;