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