如何在SQL Server 2005中记录某些记录?

编程入门 行业动态 更新时间:2024-10-26 17:35:25
本文介绍了如何在SQL Server 2005中记录某些记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Iam使用Sql Server2005. Iam拿一张桌子,上面扫描了员工卡的详细信息. 对于特定日期,我有多个条目. 谁能解释如何仅获取两个日期和特定日期的条目 记录两个日期之间的所有详细信息 问候 Nirmala Saravanan

Iam using Sql server 2005. Iam taking a table having details of employee card scanned. For particular date i have multiple entries. can anyone explain how to get only two entries for particular date and taking all the details between two dates regards Nirmala Saravanan

推荐答案

select top(2)* from TableName where Date = particular Date

如果单个日期可以有多个条目,并且只想列出其中的2条,那么您应该解释从同一日期的所有可能记录中选择这2条记录的标准. 要从两个日期之间的表中选择所有记录,可以使用BETWEEN.例如 If you can have multiple entries for a single date and you want to have only 2 of those listed, then you should explain what is the criteria for selecting those 2 records from all the possible records for the same date. To select all records from a table between two dates, you can use BETWEEN. For example SELECT * FROM TableName WHERE DateColumn BETWEEN @date1 AND @date2

更多推荐

如何在SQL Server 2005中记录某些记录?

本文发布于:2023-10-22 23:58:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1519119.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   SQL   Server

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!