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,脱手写的,你自己试试
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 Python语言实验
- ¥15 SAP HANA SQL 增加合计行
- ¥20 用C#语言解决一个英文打字练习器,有偿
- ¥15 srs-sip外部服务 webrtc支持H265格式
- ¥15 在使用abaqus软件中,继承到assembly里的surfaces怎么使用python批量调动
- ¥15 大一C语言期末考试,求帮助🙏🙏
- ¥15 ch340驱动未分配COM
- ¥15 Converting circular structure to JSON
- ¥30 Hyper-v虚拟机相关问题,求解答。
- ¥15 TSM320F2808PZA芯片 Bootloader