5条回答 默认 最新
- MYcsdn_Frank 2015-12-10 09:36关注
SELECT
SUM(d.read_num) AS READ,
SUM(d.click_num) AS click,
SUM(d.read_num - t.read_num) AS diffREAD,
SUM(d.click_num - t.click_num) AS diffclick,
u.aid
FROM
tc_url AS u
LEFT JOIN tc_data AS d
ON d.uid = u.id
LEFT JOIN
(SELECT
_d.read_num,
_d.click_num,
_u.aid
FROM
tc_url AS _u
LEFT JOIN tc_data AS _d
ON _d.uid = _u.id
WHERE _u.createtime = '昨天') AS t
ON t.aid = u.aid
WHERE u.createtime = '今天'
GROUP BY u.aid机器没装SQL,脱手写的,你自己试试
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥66 关于川崎机器人调速问题
- ¥15 winFrom界面无法打开
- ¥30 crossover21 ARM64版本安装软件问题
- ¥15 mymetaobjecthandler没有进入
- ¥15 mmo能不能做客户端怪物
- ¥15 osm下载到arcgis出错
- ¥15 Dell g15 每次打开eiq portal后3分钟内自动退出
- ¥200 使用python编写程序,采用socket方式获取网页实时刷新的数据,能定时print()出来就行。
- ¥15 matlab如何根据图片中的公式绘制e和v的曲线图
- ¥15 我想用Python(Django)+Vue搭建一个用户登录界面,但是在运行npm run serve时报错了如何解决?