gpt4 book ai didi

mysql - SQL 连接中的多个条件

转载 作者:行者123 更新时间:2023-11-29 01:13:19 25 4
gpt4 key购买 nike

如何在SQL 连接中指定多个条件?我知道 A.key = B.key 是必需的,除此之外,下面是否正确指定了 SQL 中的多个条件?

ON (A.key=B.key and/or cond1 and/or cond2 ...etc)

ON (A.key=B.key where cond1 and/or cond2 ..etc)

最佳答案

您可以在连接中指定任意数量的条件,例如:

ON A.Key=B.Key
AND b.value>100
AND (a.value>b.value OR b.value2 IS NULL)

关于mysql - SQL 连接中的多个条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26733414/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com