我正在运行一个查询来搜索主表和其他链接表之间不匹配的值。问题是我在 DIS_ID 上得到一个“输入参数值”和另外三个。对此有什么想法吗?
SELECT *
FROM FILES f
WHERE f.Network_ID not in (SELECT Network_ID from Networks) OR
f.[009_Network] not in (SELECT Network_Code from Networks) OR
f.[LINE1_ID] not in (SELECT LINE_ID from LINE) OR
f.[Line 1] not in (SELECT Line_Code from LINE) OR
f.[Trans_ID] not in (SELECT Trans_ID from Transportation_Mode) OR
f.[Transportation_Mode] not in (SELECT Mode from Transportation_Mode) OR
f.[Discipline_ID] not in (SELECT DIS_ID from DISCIPLINE) OR
f.[012_Discipline] not in (SELECT [Dis Code] from DISCIPLINE) OR
f.[013_System] not in (SELECT [Sys Code] from Systems) OR
f.[System_ID] not in (SELECT System_ID from Systems);
最佳答案
我已经创建了其中一些表和查询,并且运行良好。 见附图。 enter image description here
关于SQL检查列名后输入参数值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51491939/