当前位置:网站首页>How to add a condition for an associated table in an SQL statement [null value required or not required]
How to add a condition for an associated table in an SQL statement [null value required or not required]
2022-07-01 02:08:00 【pingzhuyan】
Catalog
Didn't understand the message , Baidu search for a long time basically wants few
1. Unwanted null value
hold and Put the condition at the end
SELECT
ad.dept_id,
ad.dept_name,
au.id,
au.realname
FROM
user_post aup
LEFT JOIN dept ad ON aup.dept_id = ad.dept_id
left join build_rec_user abru
on abru.order_id=ad.dept_id
LEFT JOIN user au ON au.id = abru.user_id
WHERE ad.company_id = 100 and abru.type_id = 02. need null value

In fact, in the left join ... on Add later and Conditions = ? Screening Associated library condition
Example : left join build_rec_user abru
on abru.order_id=ad.dept_id and abru.type_id = 0
SELECT
ad.dept_id,
ad.dept_name,
au.id,
au.realname
FROM
user_post aup
LEFT JOIN dept ad ON aup.dept_id = ad.dept_id
left join build_rec_user abru
on abru.order_id=ad.dept_id
and abru.type_id = 0
LEFT JOIN user au ON au.id = abru.user_id
WHERE ad.company_id = 100 Didn't understand the message , Baidu search for a long time basically wants few
边栏推荐
- opencv -- 笔记
- VirtualBox 安装增强功能
- Mathematical knowledge: finding combinatorial number III - finding combinatorial number
- QML控件类型:ToolTip
- The whole process of AS400 API from zero to one
- SWT/ANR问题--Deadlock
- P6773 [NOI2020] 命运(dp、线段树合并)
- Upstream and downstream in software development
- halcon变量窗口的图像变量不显示,重启软件和电脑都没用
- 现在开户有优惠吗?另外,手机开户安全么?
猜你喜欢

数据探索电商平台用户行为流失分析

There is no future to be expected. It is just the last fantasy of a migrant worker before he dies

(translation) reasons why real-time inline verification is easier for users to make mistakes

【JS】【掘金】获取关注了里不在关注者里的人
![Pytorch —— 基礎指北_貳 高中生都能看懂的[反向傳播和梯度下降]](/img/6e/279dbb7a8d7a5ecd240de464c5b8b2.png)
Pytorch —— 基礎指北_貳 高中生都能看懂的[反向傳播和梯度下降]

With regard to the white box test, you have to master these skills~

Working for eight years as a programmer, but with a salary of three years after graduation, it's too late to be enlightened again

My PMP learning test experience

Ernie-gram, 显式、完备的 n-gram 掩码语言模型,实现了显式的 n-gram 语义单元知识建模。

思特奇加入openGauss开源社区,共同推动数据库产业生态发展
随机推荐
How to learn and read code
Qu'est - ce que le PMP?
[无线通信基础-15]:图解移动通信技术与应用发展-3- 数字通信2G GSM、CDMA、3G WDCMA/CDMA200/TD-SCDMA、4G LTE、5G NR概述
SWT/ANR问题--Dump时间过长导致的SWT
数学知识:满足条件的01序列—求组合数
int和位数组互转
项目管理是什么?
SWT / anr issues - ams/wms
Mathematical knowledge: 01 sequence satisfying conditions - find combinatorial number
After working for 6 years, let's take stock of the golden rule of the workplace where workers mix up
如何选择券商?另外,手机开户安全么?
Electron pit Addon
Ernie gram, an explicit and complete n-gram mask language model, implements explicit n-gram semantic unit knowledge modeling.
Short video platform development, relying on drawerlayout to achieve side sliding menu effect
How does ZABBIX configure alarm SMS? (alert SMS notification setting process)
halcon数组的一些使用
Delete duplicate email
A preliminary understanding of operator overloading
What is PMP?
计算特殊奖金