oracle-hr表查询命令练习(超完整的select命令大全)

 

切换到 oracle的 hr用户下面练习

 

1.  查询工资大于12000的员工姓名和工资

 

Select initcap(concat(last_name,first_name)) "姓名",salary from employees where salary>12000;

 

2.  查询员工号为176的员工的姓名和部门号

 

select initcap(concat(last_name,first_name)) "姓名",department_id from employees where employee_id = 176;

 

3.  选择工资不在5000到12000的员工的姓名和工资

 

select initcap(concat(last_name,first_name)) "姓名", salary from employees where salary<5000 or salary>12000;

 

4.  选择雇用时间在1908-02-01到1908-05-01之间的员工姓名,job_id和雇用时间

写法一:

select initcap(concat(last_name,first_name)) "姓名",job_id,hire_date from employees where hire_date between '01-2 -08' and  '01-5 -08';

写法二:

select initcap(concat(last_name,first_name)) "姓名",job_id,hire_date from employees where hire_date between to_date('1908-02-01','YYYY-MM-DD') and to_date('1908-05-01','YYYY-MM-DD');

 

5.  选择在20或50号部门工作的员工姓名和部门号

写法一:

Sel

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值