关于mysql:instr字符查找函数的使用

MySql的sql语句学习之instr()字符查找函数的应用:

    INSTR(str,substr)

    str:从哪个字符串中搜寻

    substr:要搜寻的子字符串

    instr()函数不辨别大小写
  1. instr(colName,string1)查问列名蕴含字符串1的后果,e.g,
    select userName from t_user_info where userName like concat("%",'江苏',"%");

    select userName from t_user_info where instr(userName,'江苏');
    select userName from t_user_info where instr(userName,'江苏')>0;
    查问后果雷同
  2. SELECT INSTR(string1,string2)在string1中查找string2字符串并输入下标,e.g,

https://www.cnblogs.com/mr-wuxiansheng/p/6531221.html

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理