如何针对同一子查询组合两个Where/And 子句?
我正在微调存储过程,并且我的每个子查询都充当(或至少看起来充当)一个迷你乘法器。我尝试了几种不同的方法,但现在我不太确定它是否像我想象的那么简单。我不断收到无效的关系运算符。如果这应该很容易,请随时告诉我继续尝试。
我想结合以下两个比较,但我找不到正确的语法。我将列出到目前为止我所尝试过的内容。提前致谢
WHERE T.Column_Name = (...Subquery)
AND S.Column_Name = (...Subquery) --same subquery as above
到目前为止我尝试过的都是沿着这条线的变体,
WHERE (T.Column_Name AND S.Column_Name) = (...Subquery)
WHERE (T.Column_Name, S.Column_Name) ...
WHERE (T.Column_Name AND S.Column_Name = (...Subquery))
非常感谢任何帮助
I'm fine tuning a stored procedure and each subquery I have acts (or at least appears to act) as a mini multiplier. I've tried a few different ways but now I'm not so sure it's as easy as I thought it should be. I keep getting invalid relational operators. If this should be easy feel free to tell me to just keep trying.
I'd like to combine the following two comparisons but I can not find the correct syntax. I'll list what I've tried so far after. Thanks in advance
WHERE T.Column_Name = (...Subquery)
AND S.Column_Name = (...Subquery) --same subquery as above
What I've tried so far are variants along this line
WHERE (T.Column_Name AND S.Column_Name) = (...Subquery)
WHERE (T.Column_Name, S.Column_Name) ...
WHERE (T.Column_Name AND S.Column_Name = (...Subquery))
any help is greatly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
Try
如果表 T 和 S 中的列应该等于相同的子查询结果,那么它们可能是连接条件的列。因此你可以尝试这样的事情:
If the columns from table T and S should be equal to the same subquery result, then they are probably the columns of the join condition. Therefore you could try something like: