Oracle常用基本语句查询创建等.docVIP

  • 5
  • 0
  • 约6.45千字
  • 约 6页
  • 2017-01-06 发布于重庆
  • 举报
Oracle常用基本语句查询创建等

查询块 批量查询 SQLselect * from emp where in(123,456,789); //查询一个条件的多个情况的批量处理 查询某个数据行的某列为空的数据的相关数据 SQL select * from emp where mgr is null; 条件组合查询(与、或) SQLselect * from emp where (sal500 or job=’MANAGER’) and ename like ‘J%’; Order by 排序 【1】SQLselect * from emp order by sal (asc); //从低到高[默认] 【2】SQLselect * from emp order by sal desc; //从高到低 【3】SQLselect * from emp order by deptno (asc),sal desc; //组合排序 【4】SQLselect ename,sal*12 “年薪” from emp order by “年薪” (asc); SQL select ename,(sal+nvl(comm,0))*12 as 年薪 from emp order by 年薪; 资料分组(max、min、avg、sum、count) SQLselect max(sal),min(sal) from

文档评论(0)

1亿VIP精品文档

相关文档