码迷,mamicode.com
首页 > 数据库 > 详细

sql

时间:2018-09-14 18:28:26      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:amp   left join   empty   related   sel   ble   status   from   mit   

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

标签:amp   left join   empty   related   sel   ble   status   from   mit   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!