您好我知道这个查询有什么问题
SELECT [no]
-- into #mytemp
FROM [pcb_comp]
where no in (SELECT [no] FROM [Data_Query].[dbo].[query]
where [no] NOT IN (select no from [IPTS2].[dbo].[abc]))
and location = 'PCB'
order by no
答案 0 :(得分:0)
如果与位置列的排序规则冲突出现问题,请使用以下方法:
SELECT [no]
-- into #mytemp
FROM [pcb_comp]
where no in (SELECT [no] FROM [Data_Query].[dbo].[query]
where [no] NOT IN (select no from [IPTS2].[dbo].[abc]))
and location COLLATE DATABASE_DEFAULT = 'PCB' COLLATE DATABASE_DEFAULT
order by no
同样适用于您的' in'如果上面的过滤器不起作用。