日期:2014-05-16 浏览次数:20992 次
SELECT * FROM tb_statistic_stat s, (SELECT COUNT(id) visitCount,uid FROM tb_statistic_exit WHERE 1=1 GROUP BY uid) v, tb_developers_service d WHERE s.uid=v.uid AND s.cpid = d.developersId AND s.appid = d.productsId limit 0,10
Create Table CREATE TABLE `tb_statistic_stat` ( `uid` varchar(36) NOT NULL, `appid` varchar(255) DEFAULT NULL, `chid` varchar(10) DEFAULT NULL, `cpid` varchar(10) DEFAULT NULL, `cydia` varchar(255) DEFAULT NULL, `lang` varchar(255) DEFAULT NULL, `operator` varchar(255) DEFAULT NULL, `ua` varchar(255) DEFAULT NULL, `udid` varchar(255) DEFAULT NULL, `ver` varchar(50) DEFAULT NULL, `version` varchar(50) DEFAULT NULL, `macAddress` varchar(255) DEFAULT NULL, `timeString` datetime DEFAULT NULL, PRIMARY KEY (`uid`) ) CREATE TABLE `tb_statistic_exit` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` varchar(500) DEFAULT NULL, `visitTime` datetime DEFAULT NULL, `onlineTime` varchar(500) DEFAULT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `tb_developers_service` ( `id` int(11) NOT NULL AUTO_INCREMENT, `developersName` varchar(20) DEFAULT NULL, `productsName` varchar(10) DEFAULT NULL, `productsUrl` varchar(255) DEFAULT NULL, `appId` int(255) DEFAULT NULL, `developersId` varchar(10) DEFAULT NULL, `productsId` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) )