日期:2014-05-16 浏览次数:20992 次
mysql> select @str := "34173cb38f07f89d"; +----------------------------+ | @str := "34173cb38f07f89d" | +----------------------------+ | 34173cb38f07f89d | +----------------------------+ 1 row in set mysql> select @str; +------------------+ | @str | +------------------+ | 34173cb38f07f89d | +------------------+ 1 row in set mysql> select @str, concat(left(@str, 4), " ", substring(@str, 4, 4), " ", substring(@str, 8, 4), " ", right(@str, 4)) as "new_str"; +------------------+---------------------+ | @str | new_str | +------------------+---------------------+ | 34173cb38f07f89d | 3417 73cb 38f0 f89d | +--+--+ 1 row in set