SQL 查询帮助:随机选择当月员工
任何人都可以告诉我如何从此语句中获取记录
- 选择随机员工,该员工不是过去 x 个月内该月的员工
表员工
身份证号
EmployeeName
表 EmployeeOfTheMonth
身份证号
员工ID
月份开始日期
月结束日期
非常感谢
Could any one show me how to get record from this statement
- Select random employee which is not an employee of the month in the last x months
Table Employee
ID
EmployeeName
Table EmployeeOfTheMonth
ID
EmployeeID
MonthStartedDate
MonthEndedDate
Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修改上一个答案,我更喜欢使用 IN 语句
Modification of last answer, i prefer to use IN statment
...或类似的东西。 我没有运行sql,但是在mssql服务器上,这应该是正确的。
... or something close to that. i didn't run the sql, but on mssql server, this should be about right.