Oracle-Ebs-开发心得.docVIP

  • 6
  • 0
  • 约1.35万字
  • 约 12页
  • 2019-06-01 发布于浙江
  • 举报
技术心得 一、SQL查询: 1、”列出同部门中工资高于1000的员工数量超过2人的部门,显示部门名字、地区名称”.查询语句如下: select distinct dept.department_name,loc.city from employees emp,departments dept,locations loc where emp.department_id=dept.department_id and dept.location_id=loc.location_id and EXISTS( select 1 from employees emp2 where emp2.department_id=emp.department_id and emp2.salary1000 group by emp2.department_id having count(emp2.department_id)2 ) 通常我们只需要对记录逐行的筛选,对于分组数据我们只能使用分组语句avg、max等,也就是说如果你想在select中得到这个属性那么“它们“也必须出现在group by中或者你只想得到一个统计数据.回顾上面的例子,我们也可以用以下语句完成: select dept.department_name,loc.city,count(*) from

文档评论(0)

1亿VIP精品文档

相关文档