mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/local/home/marty/MySQL/mysql-5.0
This commit is contained in:
@ -160,3 +160,20 @@ t1 CREATE TABLE `t1` (
|
||||
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (EMPNUM INT);
|
||||
INSERT INTO t1 VALUES (0), (2);
|
||||
CREATE TABLE t2 (EMPNUM DECIMAL (4, 2));
|
||||
INSERT INTO t2 VALUES (0.0), (9.0);
|
||||
SELECT COALESCE(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM,
|
||||
t1.EMPNUM AS EMPMUM1, t2.EMPNUM AS EMPNUM2
|
||||
FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM;
|
||||
CEMPNUM EMPMUM1 EMPNUM2
|
||||
0.00 0 0.00
|
||||
2.00 2 NULL
|
||||
SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM,
|
||||
t1.EMPNUM AS EMPMUM1, t2.EMPNUM AS EMPNUM2
|
||||
FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM;
|
||||
CEMPNUM EMPMUM1 EMPNUM2
|
||||
0.00 0 0.00
|
||||
2.00 2 NULL
|
||||
DROP TABLE t1,t2;
|
||||
|
Reference in New Issue
Block a user