0
Follow
2
View

Take some of these vendor codes, they can

ddr520520 注册会员
2023-02-25 02:41

Based on Monster group and GPT:
Both statements express the same meaning, find the supplier code that can supply at least one of the red parts from the supplier.

However, the condition in the exists subquery in the second statement is incorrect. In the second exists subquery, instead of the PB table, the SPJB table should be used to check if there is a particular vendor offering a particular part for a particular project. Meanwhile, the equality condition(i.e. SPJB.SN=SB.SN AND SPJB.PN=PB.PN AND SPJB.JN=JN) should be used in the second exists subquery instead of the NOT EXISTS subquery.

Therefore, the correct SQL statement would be:
SELECT SN
FROM SB
WHERE NOT EXISTS (
SELECT *
FROM SPJB
WHERE SPJB.SN = SB.SN AND SPJB.PN IN (
SELECT PN
FROM PB
WHERE COLOR = '红'
)
AND NOT EXISTS (
SELECT *
FROM SPJB AS SPJB2
WHERE SPJB2.SN = SB.SN AND SPJB2.PN = SPJB.PN AND SPJB2.JN = SPJB.JN
)
)





About the Author

Question Info

Publish Time
2023-02-25 02:41
Update Time
2023-02-25 02:41

Related Question

组Microsoft SQL Server得到一个人拿着箱子的时间

如何防止串.TrimStart OutOfMemoryException

DjangoFilterConnectionField接口

重置系统后office软件显示文件映射错误

换电脑以后offic提示

在JProfiler中找到PDFBox FileNotFoundException

打开空文件后的End_of_stream属性

在读取面文件位置栅格数据时,出现Access window out of range in RasterIO()的问题

Shell脚本调用“zsh -l && some_command”从不运行some_command

当请求张贴使用Retrofit2在android java,我可以看到错误