sql函数_DATEDIFF()

datediff()函数,返回两个日期之间的天数;

语法:

 1 DATEDIFF(expr1,expr2) 

某表中当天所有记录,表中字段create_time 类型为datetime:

select * from table where  datediff(create_time,now())=0

猜你喜欢

转载自www.cnblogs.com/wangtiaotiao/p/11010133.html