mysql数据库 查询指定某天的数据

mysql数据库 查询指定某天的数据,第1张

select * from table where FROM_UNIXTIME(time, '%Y-%m-%d')=date_format('2019-08-16', '%Y-%m-%d')

select * from 表 where date_format(日期,'%Y-%m-%d')='2014-04-01' 日期

select * from 表 where date_format(日期,'%Y-%m')='2014-04' 月份

select * from 表 where date_format(日期,'%Y')='2014' 年

就是date_format(日期,'%Y-%m-%d') 这里的参数长短


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/8596217.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-18
下一篇 2023-04-18

发表评论

登录后才能评论

评论列表(0条)

保存