首页 > 其他分享 >模糊查询

模糊查询

时间:2022-08-31 14:36:34浏览次数:36  
标签:studentName -- 模糊 查询 studentNo student where select

-- 查询姓刘的同学

-- like 结合  %(表示0到任意个字符) _(表示一个字符)

select `studentNo`, `studentName` from student where studentName LIKE '刘%'

-- 查询姓刘的同学后面分别只有一个字的,两个字的

select `studentNo`, `studentName` from student where studentName LIKE '刘_'

select `studentNo`, `studentName` from student where studentName LIKE '刘__'

-- 查询姓名中间有一个嘉字的

select `studentNo`, `stundetName` from student where studentName LIKE '%嘉%'

 

-- in

-- 查询1001,1002,1003号

select `studentNo`, `studentName` from student where studentNo IN (1001,1002,1003)

-- 查询在北京的学生

select `studentNo`, `studentName` from student where address IN ('北京', '安徽')

-- null  not null

select `studentNo`, `studentName` from student where address='' OR adress IS NULL

-- 查询有出生日期的同学

select `studentNo`, `studentName` from student where BornDate !='' OR BornDate IS NOT NULL

-- 查询没有出生日期的同学

select `studentNo`, `studentName` from student where BornDate IS NULL 

 

标签:studentName,--,模糊,查询,studentNo,student,where,select
From: https://www.cnblogs.com/gss01/p/16642954.html

相关文章

  • 美团二面:加密后的数据如何进行模糊查询??被问懵了。。
    我们知道加密后的数据对模糊查询不是很友好,本篇就针对加密数据模糊查询这个问题来展开讲一讲实现的思路,希望对大家有所启发。为了数据安全我们在开发过程中经常会对重要的......
  • 在 WebGPU 中使用时间戳查询
    目录概述按步教学0.让浏览器具备时间戳查询功能1.创建Queryset和缓冲对象2.写入时间戳3.解析时间戳到缓冲对象中4.读取查询结果5.(可选)添加标签致谢原文https:......
  • 使用 JavaScript Map Method 组合 mongo 查询的算法
    使用JavaScriptMapMethod组合mongo查询的算法假设您有大量数据,并且您想查找选定品牌的特定产品,例如尼卡化妆品和一个特定的类别,例如润唇膏从中。你的代码看起来......
  • CentOS 系统查询开机启动项服务
    在运维Linux系统是安装了一些环境依赖需要加入到开机启动项。时间久了根本不知道到底哪些服务加入了开机启动项。重启服务器后不是个用不了就是那个用不了。在不确认的情况......
  • 查询文件的版本号Copyright信息
    查询文件的版本号Copyright信息目前找到的实用的方法有两种,一种是cmd中利用wmic的库,一种是C#中的GetVersionInfo()方法。CMD中获取:获取单个文件:遍历某文件夹下所有文......
  • 涉及区间的查询
    1.找出一系列连续的值问题:判断哪些行表示一系列连续的项目。即某一行项目开始时间和前一行的项目结束时间是一致的。示例表:  解决方案:利用窗函数......
  • 【转】SpringBoot ElasticSearch 各种查询汇总
    原文连接:https://www.cnblogs.com/jelly12345/p/14765477.html 一:文档对象如下@Data@AllArgsConstructor@NoArgsConstructor@Document(indexName="items",type......
  • mybatis查询参数Set遍历查询
    #sqlmapper<resultMapid="BaseResultMap"type="com.LogEntity"><resultcolumn="ID"property="ID"/><resultcolumn="content_md5"property="co......
  • MyBatis复杂映射开发之多对多查询
    多对多查询的模型用户表和角色表的关系为,一个用户有多个角色,一个角色被多个用户使用。多对多查询的需求:查询所有用户的同时查询出该用户对应的所有角色。@startuml!th......
  • mysql查询
    目录in和exists的区别结论原理in和exists的区别结论A.idin(B)适合子表b比主表a表数据量小的情况。A.idexists(B)则相反原理in子表驱动主表,是先查出(B)的数据,2个......