1、select 字段列表 from 表名:查询表中的数据
2、create table 表名1 as select * from 表名2 :创建一张表1并将从表2中的数据值复制到表1.
3、select * from 表名1 where (字段名1=’ ’ and 字段名 2= ’ ') or 字段名2 = ’ ';
4、select * from 表名1 where 字段名1 = ’ ’ and (字段名2 = ’ ’ or 字段名2 = ’ ');
5、trunc()取整数据
6、查询不包含某个字段的信息
6.1、<> 表示不包含
6.2、not in 表示不包含
7、模糊查询需要用like查询,其中通配符:%表示任意个字符, _表示1个字符:select * from 表名 where 字段 like ‘’;
7.1、select * from t_teacher where tname like ‘王%’; – 模糊查询第一个字符为王的名字
7.2、select * from t_teacher where tname like ‘%诚%’; – 模糊查询含有字符为诚的名字。
7.3、select * from t_teacher where tname like ‘_康’; – 查询名字有两个字,而且后面的一个字为康的姓名。
7.4、特别:查询五个字符的查询语句