笔记--sql语句

SELECT * FROM
(SELECT a.id,a.catid,a.title,a.thumb,a.description,a.pinpai,b.count,b.posnum FROM buses17_brand AS a LEFT JOIN buses17_statistics_res AS b ON a.id=b.cxid where a.catid = 38 and b.type=2 and (a.energy like ‘%纯电动%‘ or a.energy like ‘%混合动力%‘ or a.energy like ‘%燃料电池%‘) ORDER BY posnum DESC,count DESC limit 100)temp
GROUP BY temp. pinpai order by posnum desc,count desc

笔记--sql语句

上一篇:oracle spool 导出csv |查询出某张表所有字段名,用 ||','|| 分隔


下一篇:SQL - CONSTRAINT