mysql 笔记二
来源:互联网 发布:时间自动校准软件 编辑:程序博客网 时间:2024/06/07 03:44
//查询varchar刑
select * from user where name='gaogao';
//价格小于100元
select * from products where price<100;
//价格小于等于100元
select * from products where price<=100;
//查询姓名不是gaogao的
select * from user wherename<>'gaogao'
//查询id 不是10的用户
select * from user whereid<>10;
//用另一个 !=
select * from user where id!=10;
//用between 限定范围
select * from user where id between10 and 20;
前一个是开始值,后一个是结束值
如果将20 和10替换掉,就得不到结果
//空值检查
null
select * from user where phone is null;
//逻辑操作符 and
select * from products where id<100 andprice<50;
查询出前100个价格低于50元的商品
//or
select * from user where id=10 or id=11;
//or与 and 系统会默认调用and
select * from product where (id>100 orid<10) and price =50
//是查询id大于100或者小于10的商品中,价格为50的商品
如果不加()
select * from product where id>100 orid<10 and price=50
解释为 id小于10并且价格为50的商品,获取id大于100的商品
//in在。。。里
select * from user where id in(10.20.30.40);
//not in 不在。。里,,找出与条件不匹配的行
select * from user where id not in (10.20.30);
- mysql 笔记二
- 学习笔记 二
- mysql 笔记一
- mysql 笔记四
- Mysql 学习笔记
- 在Linux 环境下安装 Mysql(二)
- bash shell笔记3 结构化命令二
- 金蝶ERP EAS7.0 理解笔记(二)
- Sprite Kit学习笔记(二)
- mysql 笔记三 (联系正则表达式)
- MySQL 学习笔记 二
- Mysql学习笔记二
- mysql学习笔记二
- Mysql学习笔记(二)
- mysql笔记(二)
- mysql学习笔记二
- MySQL 学习笔记 二
- MySQL 学习笔记 二
- js 获取复选框的值
- 网站流量统计 cnzz
- mysql 笔记一
- 开发日记
- FLASH-与JS通讯---相关
- mysql 笔记二
- hei你懂的(转)
- mysql 基础(转)
- 关于如何手动关闭MOTO-Defy…
- 一些好的论坛与博客
- mysql 笔记三 (联系正则表达式)
- mysql 笔记四
- 寻找春天 九宫格日记-2012.08.03
- windows下安装和使用geany