select count(id) from news group by class order by ..limit N,N
select count(id) from news group by class order by ..limit N,N这样不行呀,不能同时统计今日的新闻数量、图片新闻数量、已审核的新闻数量不知道能不能这么写 select count(id) as newsId , count(img_path!='') as imgNum, count(status='1') as status from news group by class order by ..limit N,N呵呵,用where判断条件不知道怎么写
$sql=" select .... where 1 and 图片新闻数量 and 已审核的新闻数量"; $sql.=" and TO_DAYS(NOW()) - TO_DAYS(addtime) =0"; $sql.=" ... ";
select count(id) as newsId , count(img_path!='') as imgNum, count(status='1') as status from news group by class order by ..limit N,N呵呵,用where判断条件不知道怎么写
$sql.=" and TO_DAYS(NOW()) - TO_DAYS(addtime) =0";
$sql.=" ... ";