随笔分类 -  sqlserver

摘要:select top N-M+1 * from tablename where id not in (select top M-1 id from tablename order by id) order by id 阅读全文
posted @ 2022-02-09 09:49 密西西比的深蓝 阅读(73) 评论(0) 推荐(0)
摘要:表结构:要求:查询有多个员工的工资不低于2000的部门编号(就是说如果一个部门的员工大于2000的人数有两个或两个以上就查询出来)sql语句:select [DEPARTMENT_ID],count([SALARY])from [DEPARTMENT]where [SALARY]>'2000'gro... 阅读全文
posted @ 2015-12-30 16:04 密西西比的深蓝 阅读(466) 评论(2) 推荐(0)