数据库ip:10.6.23.20 数据库是discuzx_bak 1、日期转换为UNIX时间戳,如取1月数据(2016-01-01 00:00至2016-02-0100:00), Select UNIX_TIMESTAMP('2016-02-01 00:00'); 得到unix时间戳1451577600 Select UNIX_TIMESTAMP('2016-02-01 00:00'); 得到unix时间戳1454256000 2、获取tid数据,dateline为第一步获取的unix时间戳 SELECT tid FROM `bbs_forum_post` WHEREfid=37 and first=1 and subject like '%签到记录贴%' and dateline> 1451577600 and dateline < 1454256000; 3、获取签到数据 select FROM_UNIXTIME(dateline,'%Y%m%d%H:%i'),author from bbs_forum_post where fid = 37 and tid in (第二步获取到的tid数据) ; 如: select FROM_UNIXTIME(dateline,'%Y%m%d %H:%i'),authorfrom bbs_forum_post where fid = 37 and tid in(234047,233050,232025,231001,229990,228972,227966,226951,225943) ; 4、将数据取出,提供给运营同事
|