📄 func_str.result
字号:
drop table if exists t1,t2;set names latin1;select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lohello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'loselect 'hello' 'monty';hellohellomontyselect length('\n\t\r\b\0\_\%\\');length('\n\t\r\b\0\_\%\\')10select bit_length('\n\t\r\b\0\_\%\\');bit_length('\n\t\r\b\0\_\%\\')80select char_length('\n\t\r\b\0\_\%\\');char_length('\n\t\r\b\0\_\%\\')10select length(_latin1'\n\t\n\b\0\\_\\%\\');length(_latin1'\n\t\n\b\0\\_\\%\\')10select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h');concat('monty',' was here ','again') length('hello') char(ascii('h')) ord('h')monty was here again 5 h 104select hex(char(256));hex(char(256))0100select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;locate('he','hello') locate('he','hello',2) locate('lo','hello',2)1 0 4select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE');instr('hello','HE') instr('hello',binary 'HE') instr(binary 'hello','HE')1 0 0select position(binary 'll' in 'hello'),position('a' in binary 'hello');position(binary 'll' in 'hello') position('a' in binary 'hello')3 0select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5) ;left('hello',2) right('hello',2) substring('hello',2,2) mid('hello',1,5)he lo el helloselect concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)) ;concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1))happyselect substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1);substring_index('www.tcx.se','.',-2) substring_index('www.tcx.se','.',1)tcx.se wwwselect substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx',-1);substring_index('www.tcx.se','tcx',1) substring_index('www.tcx.se','tcx',-1)www. .seselect substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1);substring_index('.tcx.se','.',-2) substring_index('.tcx.se','.tcx',-1)tcx.se .seselect substring_index('aaaaaaaaa1','a',1);substring_index('aaaaaaaaa1','a',1)select substring_index('aaaaaaaaa1','aa',1);substring_index('aaaaaaaaa1','aa',1)select substring_index('aaaaaaaaa1','aa',2);substring_index('aaaaaaaaa1','aa',2)aaselect substring_index('aaaaaaaaa1','aa',3);substring_index('aaaaaaaaa1','aa',3)aaaaselect substring_index('aaaaaaaaa1','aa',4);substring_index('aaaaaaaaa1','aa',4)aaaaaaselect substring_index('aaaaaaaaa1','aa',5);substring_index('aaaaaaaaa1','aa',5)aaaaaaaaa1select substring_index('aaaaaaaaa1','aaa',1);substring_index('aaaaaaaaa1','aaa',1)select substring_index('aaaaaaaaa1','aaa',2);substring_index('aaaaaaaaa1','aaa',2)aaaselect substring_index('aaaaaaaaa1','aaa',3);substring_index('aaaaaaaaa1','aaa',3)aaaaaaselect substring_index('aaaaaaaaa1','aaa',4);substring_index('aaaaaaaaa1','aaa',4)aaaaaaaaa1select substring_index('aaaaaaaaa1','aaaa',1);substring_index('aaaaaaaaa1','aaaa',1)select substring_index('aaaaaaaaa1','aaaa',2);substring_index('aaaaaaaaa1','aaaa',2)aaaaselect substring_index('aaaaaaaaa1','1',1);substring_index('aaaaaaaaa1','1',1)aaaaaaaaaselect substring_index('aaaaaaaaa1','a',-1);substring_index('aaaaaaaaa1','a',-1)1select substring_index('aaaaaaaaa1','aa',-1);substring_index('aaaaaaaaa1','aa',-1)1select substring_index('aaaaaaaaa1','aa',-2);substring_index('aaaaaaaaa1','aa',-2)aa1select substring_index('aaaaaaaaa1','aa',-3);substring_index('aaaaaaaaa1','aa',-3)aaaa1select substring_index('aaaaaaaaa1','aa',-4);substring_index('aaaaaaaaa1','aa',-4)aaaaaa1select substring_index('aaaaaaaaa1','aa',-5);substring_index('aaaaaaaaa1','aa',-5)aaaaaaaaa1select substring_index('aaaaaaaaa1','aaa',-1);substring_index('aaaaaaaaa1','aaa',-1)1select substring_index('aaaaaaaaa1','aaa',-2);substring_index('aaaaaaaaa1','aaa',-2)aaa1select substring_index('aaaaaaaaa1','aaa',-3);substring_index('aaaaaaaaa1','aaa',-3)aaaaaa1select substring_index('aaaaaaaaa1','aaa',-4);substring_index('aaaaaaaaa1','aaa',-4)select substring_index('the king of thethe hill','the',-2);substring_index('the king of thethe hill','the',-2)the hillselect substring_index('the king of the the hill','the',-2);substring_index('the king of the the hill','the',-2) the hillselect substring_index('the king of the the hill','the',-2);substring_index('the king of the the hill','the',-2) the hillselect substring_index('the king of the the hill',' the ',-1);substring_index('the king of the the hill',' the ',-1)hillselect substring_index('the king of the the hill',' the ',-2);substring_index('the king of the the hill',' the ',-2) the hillselect substring_index('the king of the the hill',' ',-1);substring_index('the king of the the hill',' ',-1)hillselect substring_index('the king of the the hill',' ',-2);substring_index('the king of the the hill',' ',-2)the hillselect substring_index('the king of the the hill',' ',-3);substring_index('the king of the the hill',' ',-3) the hillselect substring_index('the king of the the hill',' ',-4);substring_index('the king of the the hill',' ',-4)the the hillselect substring_index('the king of the the hill',' ',-5);substring_index('the king of the the hill',' ',-5)of the the hillselect substring_index('the king of the.the hill','the',-2);substring_index('the king of the.the hill','the',-2).the hillselect substring_index('the king of thethethe.the hill','the',-3);substring_index('the king of thethethe.the hill','the',-3)the.the hillselect substring_index('the king of thethethe.the hill','the',-1);substring_index('the king of thethethe.the hill','the',-1) hillselect substring_index('the king of the the hill','the',1);substring_index('the king of the the hill','the',1)select substring_index('the king of the the hill','the',2);substring_index('the king of the the hill','the',2)the king of select substring_index('the king of the the hill','the',3);substring_index('the king of the the hill','the',3)the king of the select concat(':',ltrim(' left '),':',rtrim(' right '),':');concat(':',ltrim(' left '),':',rtrim(' right '),':'):left : right:select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':');concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':'):left : right:select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':');concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':'):left: right:select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':');concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':'):m:y:s:select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':');concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':'):my:sql:select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':');concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':'):my:sql:select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo");TRIM("foo" FROM "foo") TRIM("foo" FROM "foook") TRIM("foo" FROM "okfoo") ok okselect concat_ws(', ','monty','was here','again');concat_ws(', ','monty','was here','again')monty, was here, againselect concat_ws(NULL,'a'),concat_ws(',',NULL,'');concat_ws(NULL,'a') concat_ws(',',NULL,'')NULL select concat_ws(',','',NULL,'a');concat_ws(',','',NULL,'a'),aSELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"');CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"')"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')this is a testselect replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c')bbbb bb bbbbbbbb aaaa bbbbselect replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL')this is a REAL testselect soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb') H000 H4142 I51231select 'mood' sounds like 'mud';'mood' sounds like 'mud'1select 'Glazgo' sounds like 'Liverpool';'Glazgo' sounds like 'Liverpool'0select null sounds like 'null';null sounds like 'null'NULLselect 'null' sounds like null;'null' sounds like nullNULLselect null sounds like null;null sounds like nullNULLselect md5('hello');md5('hello')5d41402abc4b2a76b9719d911017c592select crc32("123");crc32("123")2286445522select sha('abc');sha('abc')a9993e364706816aba3e25717850c26c9cd0d89dselect sha1('abc');sha1('abc')a9993e364706816aba3e25717850c26c9cd0d89dselect aes_decrypt(aes_encrypt('abc','1'),'1');aes_decrypt(aes_encrypt('abc','1'),'1')abcselect aes_decrypt(aes_encrypt('abc','1'),1);aes_decrypt(aes_encrypt('abc','1'),1)abcselect aes_encrypt(NULL,"a");aes_encrypt(NULL,"a")NULLselect aes_encrypt("a",NULL);aes_encrypt("a",NULL)NULLselect aes_decrypt(NULL,"a");aes_decrypt(NULL,"a")NULLselect aes_decrypt("a",NULL);aes_decrypt("a",NULL)NULLselect aes_decrypt("a","a");aes_decrypt("a","a")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -