基本SQL,SELECT语句

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);

 

posted @ 2017-07-12 18:57  fy02223y  阅读(169)  评论(0编辑  收藏  举报