mysql比较运算,逻辑运算,范围查询,模糊查询
2024-09-01 06:46:51
比较运算 > < = != <> <= >=
逻辑运算 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)里的数据,是否在范围内
最新文章
- scheduleInRunLoop作用
- document.body.scrollTop用法
- Mac Pro Office Word 2011 个性化设置
- 批量解密SQLSERVER数据库中的各种对象的工具dbForge SQL Decryptor2.1.11
- C++编译错误syntax error : identifier &#39;THIS_FILE&#39; 解决方法
- POJ 1300 Door Man(欧拉回路的判定)
- WCF常见异常-The maximum string content length quota (8192) has been exceeded while reading XML data
- 线程2 NSOperation 抽像类的使用
- 【HTML】Beginner5:List
- Android性能分析工具介绍
- 高性能JSON库---FastJson(阿里巴巴)
- Mysql内置的profiling性能分析工具
- Ubuntu 安装 Mysql 5.6 数据库
- Unique Morse Code Words
- 第9月第26天 pairs和ipairs cocos2dx 动画
- curl dns缓存设置
- python笔记02:列表与元素
- 手把手教你写一个java的orm(完)
- 解题:USACO12FEB Nearby Cows
- Resin任意文件读取漏洞