Oracle单表的简单查询

查看表结构

desc emp;

查询所有列

Select * from emp;

查找所以部门编号(查指定的列)

select deptnofrom emp;

查找编号不同的部门编号(去重)

selectdistinct deptnofrom emp;

查找ename为SMITH的员工职位,工资,部门编号

select job,sal,deptnofrom emp t  where t.ename='SMITH';

查找员工的年薪

NVL( string1, replace_with)

功能:如果string1为NULL,则NVL函数返回replace_with的值,否则返回string1的值

+nvl(comm,0)*12as salsun , ename,sal,comm  from emp

别名的应用

select salas "工资"from emp

的员工工资

查找1982.1.1后入职的员工

select ename,hiredatefrom empwhere  hiredate>'1-1月-1982'

显示工资在2000到3000的员工

and sal<=3000;

模糊查询like,%,_

select ename,salfrom emp t   where t.enamelike'%S%';

select ename,salfrom emp t where t.enamelike'_O%';

in的使用

,1600)

is null的使用

select *from empwhere mgrisnull;

最新文章

  1. EC笔记:第4部分:20、传递引用代替传值
  2. 【白话设计模式四】单例模式(Singleton)
  3. React state的使用
  4. codeforces 429D
  5. VirtualBox下安装rhel5.5 linux系统
  6. Web中Listener的创建
  7. Android核心分析之十八Android电话系统之RIL-Java
  8. ecshop 广告位固定
  9. Android Activity 注意笔记
  10. Linux Pmap 命令:查看进程用了多少内存
  11. 博客搬家到CSDN:http://blog.csdn.net/yeweiouyang
  12. cf E. George and Cards
  13. nmap使用方法
  14. TextArea里Placeholder换行问题
  15. SqlServer循环 和 批量倒数据
  16. Linux系统的shell是什么
  17. Vue Material
  18. 【原创】大数据基础之Marathon(1)简介、安装、使用
  19. 1.2MyBatis介绍
  20. python学习笔记之基础数据和控制

热门文章

  1. 两种MD5最后的值不一样,因为两种做法不一样
  2. CheckBox控件实现选项的选中
  3. linux命令 收集
  4. mysql里的sql函数
  5. Selenium2使用vncserver启动firefox
  6. Java class文件分析工具 -- Classpy
  7. ceph之Placement Group
  8. 自己动手为PHP7添加新的语法特性
  9. chrome 浏览器帐号登录不来,如何解决自己的书签
  10. POJ 3261 可重叠的 k 次最长重复子串【后缀数组】