zoukankan      html  css  js  c++  java
  • mysql比较运算,逻辑运算,范围查询,模糊查询

    比较运算 > < =  !=  <>   <=  >= 
    逻辑运算  and  or  not
    范围查询  in  
    模糊查询  like
                                                                                                    
    select distinct age from classes;                                 将classes表格里age去重                          
    select * from classes where id <= 3;                               打印classes表格里id<=3的数据  (<>、!=)除了整形还可以用于datetime                       
    select * from classes where num is(not) null;                   打印classes表格里num栏是(否)为null       is 和 not 只能用来判断null                        
    select * from student where add_time between '2018-05-08' and '2018-05-10 09:00:00';        打印student表格里add_time栏里时间在两者之间的数据,between and相当于>=、<=可作用于时间和整形                               
    select name from student where id > 1 and id < 3;        打印student表格里id>1并<3的name栏   and or not 逻辑运算符                             
     select * from student where name like '小%';             模糊查找 like 打印student表格里姓名栏(字段)里以'小'开头的数据 
    select * from student where name like '%张%';                     
    select * from student where name like '_明';                 占位匹配  _  一个下划线代表一个字符                            
     select * from student where id (not) in (1,2,3);               打印student表格里id是(否)在(1,2,3)里的数据,是否在范围内                             
     
  • 相关阅读:
    fastapi+vue搭建免费代理IP网站部署至heroku
    如何选择免费代理ip,需要注意哪些指标值和基本参数
    如何部署MongoDB并开启远程访问Docker版
    Linux设置Frps Frpc服务开启启动
    Docker搭建VS Code Server ,设置访问密码随时随地写代码
    薅羊毛须及时 多平台微信线报提醒脚本
    python+selenium实现百度关键词搜索自动化操作
    用python selenium 单窗口单IP刷网站流量脚本
    杂记 内容会在留言中补充
    c#杂记
  • 原文地址:https://www.cnblogs.com/sunzhiqi/p/10072669.html
Copyright © 2011-2022 走看看