当前位置:网站首页>SQL左连接的关联条件问题
SQL左连接的关联条件问题
2022-06-21 12:20:00 【CSDN问答】
Hive SQL
现有 表A,B,C,D,其中以user_id作为各表关联条件 如果想通过ABCD表形成漏斗数据(A表为最大漏斗D表为最小漏斗)
select count(distinct a.user_id),count(distinct b.user_id),count(distinct c.user_id),count(distinct d.user_id)
from
(select user_id
from a
) as a
left join
(
select user_id
from b
) as b
on a.user_id=b.user_id
left join
(
select user_id
from c
) as c
on b.user_id=c.user_id
left join
(
select user_id
from d
) as d
on c.user_id=d.user_id
以表c为例 请问下关联条件处写 b.user_id=c.user_id 或 a.user_id=c.user_id 从数据差异或运行效率上会有差别吗
边栏推荐
- Compilation de l'environnement vs Code + GCC développé par stm32
- 理解RESTful架构
- Schéma technique du système de surveillance de l'environnement de la salle de distribution
- A recovery solution of system paralysis caused by upgrading glibc of VMware virtual machine
- phpstudy2018安装及打开目录浏览
- 路由器Telnet及ACL配置
- PWM (pulse width modulation) of STM32 notes
- 智能辅助系统在配电室内的施工方案 安装位置
- Huawei cloud releases desktop ide codearts
- 配电室环境监控系统技术方案
猜你喜欢
随机推荐
i.MX - RT1052输入输出(GPIO)
LeetCode-高度检查器
STM32开发之 VS Code + gcc环境编译
常用的17个运维监控系统
DVWA configuration tutorial
7. 指针
动手学数据分析 数据可视化
12 tips for achieving it agility in the digital age
Related codes of findpanel
typescript localStorage 封装
Quantitative research on heterogeneous communities 4 rate of change with bands
[cloud native | Devops] Jenkins installation and actual combat (II)
Anchor of SSD_ Box calculation
五大(七大)原则-系统学习三
The final battle of the giant: instant retailing
Snow Ice City (blackened)
2-zabbix automatically add hosts using autodiscover
【无标题】
华为是如何从0到1打造以项目为中心运作的项目管理体系的?
一篇文章带你搞懂什么是DevOps?









