sql 中有关字符串的操作

一、从字符串中根据索引截取指定字符串

    select substring(str, begin, end);

   栗子:

      

        图1、表数据

      

        图二、查询结果

二、字符串拼接

mysql:

    concat(str1, str2);

oracle:

    select str1 || str2 from dual;
    或
    select concat(str1, str2) from dual;

sql server:

    select str1 + str2;

猜你喜欢

转载自blog.csdn.net/dirtyman_/article/details/80099733