diff options
Diffstat (limited to 'mysql-test/t/subselect.test')
-rw-r--r-- | mysql-test/t/subselect.test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 68a89796ec3..3ae695c8967 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -53,4 +53,17 @@ insert into clinic values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta" insert into attend values (1,1),(1,2),(2,2),(1,3); select * from attend where exists (select * from clinic where uq = clinic_uq); +# different tipes & group functions +drop table if exists t1,t2,t3; + +CREATE TABLE t3 (a varchar(20),b char(1) NOT NULL default '0'); +INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b'); +CREATE TABLE t2 (a varchar(20),b int NOT NULL default '0'); +INSERT INTO t2 VALUES ('W','1'),('A','3'),('J','2'); +CREATE TABLE t1 (a varchar(20),b date NOT NULL default '0000-00-00'); +INSERT INTO t1 VALUES ('W','1732-02-22'),('A','1735-10-30'),('J','1743-04-13'); +SELECT * FROM t1 WHERE b = (SELECT MIN(b) FROM t1); +SELECT * FROM t2 WHERE b = (SELECT MIN(b) FROM t2); +SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3); + drop table t1,t2,t3,t4,t5,attend,clinic; |