doulingzhuang3079
doulingzhuang3079
2018-05-23 20:14

如何按日期从mysql数据库中选择数据[关闭]

已采纳

I have an DB Table with a column appointment_date [type: date], I want select all the data matching with today's date.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doude2635 doude2635 3年前

    MS SQL Server

    Use CURRENT_TIMESTAMP function

    select * from dates where appointment_date = CAST(CURRENT_TIMESTAMP AS DATE);

    MYsQL

    select * from dates where appointment_date = cast(now() as date);

    点赞 评论 复制链接分享

相关推荐