读书人

sql语句中and和between and能在一块用

发布时间: 2012-03-24 14:00:46 作者: rapoo

sql语句中and和between and能在一块用吗
比如说我要查询今天(时间条件)所有qid等于1的记录

[解决办法]
select * from tb where qid = 1 and datediff(dd,getdate(),时间字段) = 0

读书人网 >SQL Server

热点推荐