首页 > 数据库技术 > 详细

sql

时间:2018-09-14 18:10:16      阅读:165      评论:0      收藏:0      [点我收藏+]
if(!empty($site) && $site != 9){
$siteword = $site;
$sql = ‘SELECT c.id, c.name, c.related_page,c.suitable_siteids, REPLACE(suitable_siteids, 0, 1234567)as rn,c.suitable_sex_flag, c.app_order, c.status, g.num FROM wis_hotwords c LEFT JOIN (select hotwords_id, count(hotwords_id) as num
from wis_hotwords_log as t
where ‘.$whereLog.‘
group by(hotwords_id)) as g ON c.id = g.hotwords_id where ‘.$where.‘ order by ‘. $orderWhere.‘ LIMIT ‘.$offset.‘ , ‘.$pageSize;
}else{
$sql = ‘SELECT c.id, c.name, c.related_page,c.suitable_siteids,c.suitable_sex_flag, c.app_order, c.status, g.num FROM wis_hotwords c LEFT JOIN (select hotwords_id, count(hotwords_id) as num
from wis_hotwords_log as t
where ‘.$whereLog.‘
group by(hotwords_id)) as g ON c.id = g.hotwords_id where ‘.$where.‘ order by ‘. $orderWhere.‘ LIMIT ‘.$offset.‘ , ‘.$pageSize;
}

sql

原文:https://www.cnblogs.com/258w/p/9648019.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!