mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
postreview fixes
mysql-test/r/subselect_innodb.result: fixed result of test mysql-test/t/subselect_innodb.test: fixed test layout
This commit is contained in:
parent
b2f7b5bd64
commit
56080a8d1e
2 changed files with 39 additions and 2 deletions
|
|
@ -129,8 +129,19 @@ drop table t1, t2;
|
|||
#
|
||||
# possible early unlock
|
||||
#
|
||||
CREATE TABLE t1 ( id INT NOT NULL auto_increment, date1 DATE, coworkerid INT, description VARCHAR(255), sum_used DOUBLE, sum_remaining DOUBLE, comments VARCHAR(255), PRIMARY KEY(id)) engine=innodb;
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL auto_increment,
|
||||
date1 DATE, coworkerid INT,
|
||||
description VARCHAR(255),
|
||||
sum_used DOUBLE,
|
||||
sum_remaining DOUBLE,
|
||||
comments VARCHAR(255),
|
||||
PRIMARY KEY(id)
|
||||
) engine=innodb;
|
||||
insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment');
|
||||
SELECT DISTINCT (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven FROM t1;
|
||||
SELECT DISTINCT
|
||||
(SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten,
|
||||
(SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven
|
||||
FROM t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue