码迷,mamicode.com
首页 > 数据库 > 详细

sql语言

时间:2017-08-31 20:18:35      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:div   manager   纽约   字母   and   select   manage   man   使用   

select * from emp where sal between 2500 and 5000;--使用between取区间

select * from emp where sal in(2500,5000);--可以指定取想要的数;

select * from emp where sal between 1000 and 4000 and deptno in(10,20);--查询表里工资1000-4000的人,部门要在10和20的人;

select * from emp where deptno in(10,30)and ename not like‘A%‘--查询10 和30部门里没有A开头的

select * from emp where deptno in(10,30)and ename not like‘_%A%‘查询A开头除外所有没有A字母的

select * from emp e, dept d where e.deptno=d.deptno and (d.loc not like‘NEW YORK,CHICAGO‘
or job=‘MANAGER‘and e.ename not like ‘_%B%_%C%‘)--

 查询所有纽约和芝加哥工作的人中的经理和名字首字母之外不含B或C的人 

sql语言

标签:div   manager   纽约   字母   and   select   manage   man   使用   

原文地址:http://www.cnblogs.com/wbj195/p/7460222.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!