zoukankan      html  css  js  c++  java
  • BetWeen和模糊查询

    --区分大小写性能比较低
    select * from Students where Age >1 and Age <4
    select * from Students where Age between 1 and 4--取出一到四的数据包含一和四(between在数据库有优化,性能比较好,高于上面的语句)

    select * from Students where Age in(1,2,3)--查询出年龄包含1,2,3的数据
    select * from Students where Name like 'a%' --以a开头的后面不管有几个字符都可以匹配

    select * from Students where Name like '_a%'--第二个字符是a的,_表示一个任意字符
    select * from Students where Name like '__a%' --前两个是任意字符,第三个是a字符的进行匹配
    select * from Students where Name like '%[0-9]%'--查询中间任何位置有数字的
    select * from Students where Name like '%[a-z]%'--查出中间任何位置有字母的
    select * from Students where Name like '%[0-9a-z]%'--查询中间任何位置有数字或字母的
    select * from Students where Name like '%[^0-9]%' --查询中间任何位置不是数字的
    select * from Students where Name like '%[^0-9]' --查询最后位置不是数字的
    select * from Students where Name not like '%[0-9]'

  • 相关阅读:
    ASIX配置vlan tag能被wireshark获取
    翻译-cmake教程
    Manjaro打造开发环境
    Frida入门
    安卓应用启动底层执行逻辑
    集合框架
    oracle清除日志内存
    flutter widgets目录
    给设备添加udid
    5.class
  • 原文地址:https://www.cnblogs.com/sumg/p/3649446.html
Copyright © 2011-2022 走看看