日期:2014-05-16  浏览次数:20504 次

求一sql查询语句
表    名:archives
字    段:writer    pubdate
数据格式: 张三     1384858337

writer=作者名称
pubdate=提交时间

我需要列出作者为张三当日提交的所有数据,求sql查询语句。
注:因为时间戳纯数字,所以考虑是否有必要把时间戳格式化为:%Y-%m-%d %h:%i。

------解决方案--------------------
 select * from archives where date_format(FROM_UNIXTIME(pubdate),'%Y-%m-%d')=curdate() and writer='张三';

------解决方案--------------------
select * from archives where writer='张三' and pubdate between unix_timestamp(date(now)) and unix_timestamp(date(adddate(now(),1)));	

------解决方案--------------------
select * from archives where writer='张三' and pubdate between unix_timestamp(date(now())) and unix_timestamp(date(adddate(now(),1)));