summaryrefslogtreecommitdiff
path: root/mysql-test/r/sel000100.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/sel000100.result')
-rw-r--r--mysql-test/r/sel000100.result36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/sel000100.result b/mysql-test/r/sel000100.result
index e7d8cf0e7ac..3ffa4004b84 100644
--- a/mysql-test/r/sel000100.result
+++ b/mysql-test/r/sel000100.result
@@ -1,2 +1,38 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (
+ID int(11) NOT NULL auto_increment,
+NAME varchar(75) DEFAULT '' NOT NULL,
+LINK_ID int(11) DEFAULT '0' NOT NULL,
+PRIMARY KEY (ID),
+KEY NAME (NAME),
+KEY LINK_ID (LINK_ID)
+);
+INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
+INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
+INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
+CREATE TABLE t2 (
+ID int(11) NOT NULL auto_increment,
+NAME varchar(150) DEFAULT '' NOT NULL,
+PRIMARY KEY (ID),
+KEY NAME (NAME)
+);
+SELECT DISTINCT
+t2.id AS key_link_id,
+t2.name AS link
+FROM t1
+LEFT JOIN t2 ON t1.link_id=t2.id
+GROUP BY t1.id
+ORDER BY link;
key_link_id link
NULL NULL
+drop table t1,t2;
+CREATE TABLE t1 (
+html varchar(5) default NULL,
+rin int(11) default '0',
+out int(11) default '0'
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES ('1',1,0);
+SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
+html prod
+1 0.00
+drop table t1;