MySQL页面访问统计及排名情况
统计访问页面数量,以分辨率进行排名
SELECT CONCAT(`height` , \'*\', `width`) AS `resolution` , COUNT(CONCAT(`height`, \'*\', `width`)) AS `total`
FROM `wifi_status_page`
GROUP BY CONCAT(`height`, \'*\', `width`)
ORDER BY `total` DESC
LIMIT 0 ...
我们知道通常的SQL查询语句是这么写的:
复制代码 代码如下:select col from table;
这当然没问题,但如果字段名是“from”呢?
复制代码 代码如下:select from from table;
若真的这么写,必然出错,当字段名与MySQL保留字冲突时,可以用字符“`”将字段名括起来:
复制代码 代码如下:select `from` from table;...