急!!!!!!!!!! select a.dep,a.namefrom emp a join ( select dep,max(sal) as m from emp group by dep ) b on a.dep=b.dep and a.sal=b.m 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Select dep,nqme,job,Max(sal) As sal From MEP Group by dep,nqme,job select name from EMPwhere sal in( select max(sal) from EMP group by dep) select * from EMP a where sal=(select max(sal) from EMP b where a.dep=b.depand a.job=b.job and a.nqme=b.nqme) z select a.*from emp a join(select dep,sal=max(sal) from emp)b on a.dep=b.dep and a.sal=b.sal select a.dept, a.job from emp a where a.sal > (select avg(sal) from emp) 不好意思,小的还有一个问题。列出工资在900以上,或者姓氏在‘que'和'aur' 之间的,这样写可以吗?select name.emp from emp where sal>=900 or name between 'que' and 'zur' TO: viptiger(六嘎)你的语句不严谨。(你会查出工资在本部门不是最高,但是与其他某个部门的最高工资相同的员工)TO:apple00000(小子) 可以 TO:xhh_88(三友)那那个语句应该怎么写呢,是要查出所有部门工资最高的员工. victorycyz(中海) , zjcxc(邹建) ( ) 这两位不上对的吗? TO:xhh_88(三友)jion和group by 分别是什么意思不好意思,比较菜 jion --联合或合并group by --分组统计---你还是看帮助比较好些! 几个简单的SQL问题 急~参数化sql 如何使用SQL语句查到当前SQL SERVER 2000服务器的IP地址 问一个弱弱的问题:update与先delete再insert的性能问题 ERROR 2013 不知道什么问题,急~ 数据库问题 建立主键系统同时生成聚类索引并且我不能删除 大力,邹健,小梁,有时间帮帮我。关于MS2005的参数配置问题 急救呀!存储过程声明变量的问题!小第不才! 怎样获得列名 触发器中如何判断某个字段有否被更改? 请问这是为什么???
where sal in(
select max(sal) from EMP
group by dep)
and a.job=b.job and a.nqme=b.nqme) z
from emp a join(select dep,sal=max(sal) from emp)b on a.dep=b.dep and a.sal=b.sal
列出工资在900以上,或者姓氏在‘que'和'aur' 之间的,这样写可以吗?
select name.emp from emp where sal>=900 or name between 'que' and 'zur'
你的语句不严谨。(你会查出工资在本部门不是最高,但是与其他某个部门的最高工资相同的员工)
TO:apple00000(小子) 可以
那那个语句应该怎么写呢,是要查出所有部门工资最高的员工.
jion和group by 分别是什么意思
不好意思,比较菜