查找部门中最多没有学生的学生: [英] Find students of the department that has maximum no :of students

查看:67
本文介绍了查找部门中最多没有学生的学生:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


谁能给我查询以找到具有最大count.The系的学生.我有tblstudents表,其中我有stuid,stuame,deptno列.请帮助我编写此查询.我已经尝试过以下查询:

Hi,
Can anyone please give me the query to find students of the departments that has maximum count.I have tblstudents table where i have columns stuid,stuame,deptno. Please help me in writing this query. I have tried the following query:

select * 
from emp 
where deptno =(select deptno 
               from (select count(e.empno)as counts,e.deptno 
                     from emp e group by deptno) a
                     where a.counts=(select MAX(counts)  
                                     from a) );



但最终出现错误:对象名称"a"无效.

问候
Chaithanya M



But ended up with a error:Invalid object name ''a''.

Regards
Chaithanya M

推荐答案

我无法为您提供具体的答案,因为我希望您学习LINQ
所以你去
单击此处
I wont be able to give you the specific answer because i want you to learn LINQ
so here you go
Click Here


这篇关于查找部门中最多没有学生的学生:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆