sql server查询当前时间之后满足条件的指定条数据

来源:互联网 发布:centos ip forward 编辑:程序博客网 时间:2024/05/18 02:19

select top num * from table_name where column_name='1' and column_name1 > getdate();

其中num是你想要得到的数据条数,table_name是表名称,column_name和column_name1都是列名,

getdate()是得到当前时间,其中的日期是datetime类型,可以用<、>直接比较。

0 0
原创粉丝点击