首页 > 数据库技术 > 详细

基本SQL,SELECT语句

时间:2017-07-12 19:23:39      阅读:215      评论:0      收藏:0      [点我收藏+]

SQL 语言大小写不敏感。

SQL 可以写在一行或者多行 关键字不能被缩写也不能分行 各子句一般要分行写。

使用缩进提高语句的可读性。

select语句

例如表:SCOTT.EMP

技术分享

select * from SCOTT.EMP where comm > sal;

技术分享

*代表通配符。表示所有列

select sal,comm from scott.emp where ename = ‘WARD‘ ;

技术分享

注意:ename是字符串所以注意其大小写。

select *  from scott.emp where ename like ‘S%‘;

技术分享

select *from scott.emp where deptno in (10,20);

技术分享

select *from scott.emp where comm is not null;

技术分享

select sal+10000 ,ename , job,empno from scott.emp ;

技术分享

select * from (select * from scott.emp where empno>7600)  where deptno in(20,30);

技术分享

 

基本SQL,SELECT语句

原文:http://www.cnblogs.com/fy02223y/p/7157131.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!