📄 func_concat.result
字号:
DROP TABLE IF EXISTS t1;CREATE TABLE t1 ( number INT NOT NULL, alpha CHAR(6) NOT NULL );INSERT INTO t1 VALUES (1413006,'idlfmv'),(1413065,'smpsfz'),(1413127,'sljrhx'),(1413304,'qerfnd');SELECT number, alpha, CONCAT_WS('<---->',number,alpha) AS newFROM t1 GROUP BY number;number alpha new1413006 idlfmv 1413006<---->idlfmv1413065 smpsfz 1413065<---->smpsfz1413127 sljrhx 1413127<---->sljrhx1413304 qerfnd 1413304<---->qerfndSELECT CONCAT_WS('<---->',number,alpha) AS newFROM t1 GROUP BY new LIMIT 1;new1413006<---->idlfmvSELECT number, alpha, CONCAT_WS('<->',number,alpha) AS newFROM t1 GROUP BY new LIMIT 1;number alpha new1413006 idlfmv 1413006<->idlfmvSELECT number, alpha, CONCAT_WS('-',number,alpha,alpha,alpha,alpha,alpha,alpha,alpha) AS newFROM t1 GROUP BY new LIMIT 1;number alpha new1413006 idlfmv 1413006-idlfmv-idlfmv-idlfmv-idlfmv-idlfmv-idlfmv-idlfmvSELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS newFROM t1 GROUP BY new LIMIT 1;number alpha new1413006 idlfmv 1413006<------------------>idlfmvdrop table t1;create table t1 (a char(4), b double, c date, d tinyint(4));insert into t1 values ('AAAA', 105, '2003-03-01', 1);select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';a b c dAAAA 105 2003-03-01 1drop table t1;select 'a' union select concat('a', -4);aaa-4select 'a' union select concat('a', -4.5);aaa-4.5select 'a' union select concat('a', -(4 + 1));aaa-5select 'a' union select concat('a', 4 - 5);aaa-1select 'a' union select concat('a', -'3');aaa-3select 'a' union select concat('a', -concat('3',4));aaa-34select 'a' union select concat('a', -0);aaa0select 'a' union select concat('a', -0.0);aaa0.0select 'a' union select concat('a', -0.0000);aaa0.0000
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -