sql:
select 1+1 ; -- 2 (int) 数字相加为正常计算
select '1'+'1' ; -- 11 (varchar) 字符串相加为字符串拼接
select '1'+1 ; -- 2(int) 数字加字符串 会将字符串强转为数字,在进行正常计算
select 1+'j1' ; --error 字符串转换失败
mysql:
select 1+2 ; -- 3 (int) 正常计算
select '1'+'2' ; -- 3 (int) 正常计算
select 1+'2' ; -- 2(int) 数字加字符串 会将字符串强转为数字,在进行正常计算
select 1+'2ssgs'' ; --3 mysql中只会过滤到数字部分进行计算
select CONCAT('1','2') ; --12 字符串拼接
select CONCAT(1,2) ; -- 12 字符串拼接
select CONCAT('1','2sdgdsg'); --12sdgdsg 字符串拼接
select CONCAT('1h',2,'3t','5hdhd'); --1h23t5hdhd concat支持多个字符串拼接