zoukankan      html  css  js  c++  java
  • SQL instr()函数的格式

    格式一:instr( string1, string2 )    /   instr(源字符串, 目标字符串)
    格式二:instr( string1, string2 [, start_position [, nth_appearance ] ] )   /   instr(源字符串, 目标字符串, 起始位置, 匹配序号)
    解析:string2 的值要在string1中查找,是从start_position给出的数值(即:位置)开始在string1检索,检索第nth_appearance(几)次出现string2。
    SELECT
      grade_type,
      teacher_name,
      grade_type->'$[*].id'
    FROM tb_teacher
    WHERE
    (INSTR(grade_type->'$[*].id', '"1"') OR
          INSTR(grade_type->'$[*].id', '"2"') OR
          INSTR(grade_type->'$[*].id', '"3"') OR
          INSTR(grade_type->'$[*].id', '"4"') OR
          INSTR(grade_type->'$[*].id', '"5"') OR
          INSTR(grade_type->'$[*].id', '"6"'))
    AND (!INSTR(grade_type->'$[*].id', '"7"')
          AND !INSTR(grade_type->'$[*].id', '"8"')
          AND !INSTR(grade_type->'$[*].id', '"9"')
          AND !INSTR(grade_type->'$[*].id', '"10"')
          AND !INSTR(grade_type->'$[*].id', '"11"')
          AND !INSTR(grade_type->'$[*].id', '"12"')
          AND !INSTR(grade_type->'$[*].id', '"13"')
          )
  • 相关阅读:
    制作一个漂亮的表格
    模版语言
    Django 学习
    linux系统服务名称
    CentOS下netstat + awk 查看tcp的网络连接状态
    Python的MySQLdb模块安装
    shellinabox安装
    堡垒机 paramiko 自动登陆代码
    堡垒机 paramiko代码
    Paramiko 模块使用
  • 原文地址:https://www.cnblogs.com/87060524test/p/10402780.html
Copyright © 2011-2022 走看看