本文介绍了如何获得所有差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗨我有这张桌子,我想得到所有不同的东西。我已经尝试了 Excepts,Not in,Exists 等,但我得到的正确数字与excel一样。 ProjectNr Ist Value Soll Value D.01025 0 19010 D.01048 0 0 D.01620 0 409196 G.01013 20766,31575 20406,21832 G.10002 3409,73749 3707,07765 G.10004 8052,97646 8057,03358 G .01006 1,50104 1,50104 G.00960 585385,8582 543435,6963 G.01961 11000 0 G.01003 2210,34804 2184,59583 G.01004 637,73126 637,38993 G.01005 1557,47348 1424,94381 G.01113 745,29877 745,93531 G.01043 29285,59879 28600,87531 G .01162 23226 0 G.01069 72765,80058 73450,86162 我想这样做: 1.什么价值不是Ist值(Soll不在Ist) 2.Ist值不是Soll值(Ist)不在Soll中) 3.什么是soll值Ist(Soll in Ist) 4. Soll的价值是什么(Ist in Soll) 专业解决方案: Soll not in Ist Ist not in Soll Soll in Ist in Soll 19.010,00 - - - - - - 409.196,00 - - - - 20.406,22 20.766,32 - 3.707,08 3.409,74 - 8.057,03 8.052,98 - 1, 50 1,50 - 543.435,70 585.385,86 11.000,00 - - - 2.184,60 2.210,35 - 637,39 637,73 - 1.424,94 1.557,47 - 745,94 745,30 - 28.600,88 29.285,60 23.226,00 - - - 73.450,86 72.765,80 1 。 SELECT [Soll_value] AS Soll FROM [dbo]。[表1] WHERE NOT IN ( SELECT [Ist_value] AS Ist FROM [dbo]。[Table1] 2 。 SELECT [Ist_value] AS Ist FROM [dbo]。[表1] WHERE NOT IN ( SELECT [Soll_value] AS Ist FROM [dbo]。[表1] 2 (替代)。 SEL ECT [Soll_value] AS Soll FROM [dbo]。[表1] EXCEPT SELECT [Ist value] AS Ist FROM [dbo]。[Table1] 3 。 SELECT [Soll_value] AS Soll FROM [dbo]。[表1] WHERE EXISTS IN ( SELECT [Ist_value] AS Ist FROM [dbo]。[Table1] 4 。 SELECT [Ist_value] AS Ist FROM [dbo]。[表1] WHERE EXISTS IN ( SELECT [Soll_value] AS Ist FROM [dbo]。[表1] 解决方案 Hi i have this one table and i wanna get all the differenves. I have tried Excepts, Not in, Exists etc but i'ant getting the right figures like with excel. ProjectNrIst ValueSoll ValueD.01025 0 19010D.01048 0 0D.01620 0 409196G.01013 20766,31575 20406,21832G.10002 3409,73749 3707,07765G.10004 8052,97646 8057,03358G.01006 1,50104 1,50104G.00960 585385,8582 543435,6963G.01961 11000 0G.01003 2210,34804 2184,59583G.01004 637,73126 637,38993G.01005 1557,47348 1424,94381G.01113 745,29877 745,93531G.01043 29285,59879 28600,87531G.01162 23226 0G.01069 72765,8005873450,86162I wanna do something like this:1.What soll-values are not in Ist value (Soll not in Ist)2.What Ist values are not in Soll values (Ist not in Soll)3.What soll values are in Ist (Soll in Ist)4.What Ist values are in Soll (Ist in Soll)Experted Solution: Soll not in Ist Ist not in Soll Soll in Ist Ist in Soll 19.010,00 - - - - - - 409.196,00 - - - - 20.406,22 20.766,32 - 3.707,08 3.409,74 - 8.057,03 8.052,98 - 1,50 1,50 - 543.435,70 585.385,86 11.000,00 - - - 2.184,60 2.210,35 - 637,39 637,73 - 1.424,94 1.557,47 - 745,94 745,30 - 28.600,88 29.285,60 23.226,00 - - - 73.450,86 72.765,80 1.SELECT [Soll_value] AS SollFROM [dbo].[Table1]WHERE NOT IN (SELECT [Ist_value] AS Ist FROM [dbo].[Table1]2.SELECT [Ist_value] AS IstFROM [dbo].[Table1]WHERE NOT IN (SELECT [Soll_value] AS Ist FROM [dbo].[Table1]2(alternative).SELECT [Soll_value] AS SollFROM [dbo].[Table1]EXCEPTSELECT [Ist value] AS IstFROM [dbo].[Table1] 3.SELECT [Soll_value] AS SollFROM [dbo].[Table1]WHERE EXISTS IN (SELECT [Ist_value] AS Ist FROM [dbo].[Table1]4.SELECT [Ist_value] AS IstFROM [dbo].[Table1]WHERE EXISTS IN (SELECT [Soll_value] AS Ist FROM [dbo].[Table1] 解决方案 这篇关于如何获得所有差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-21 21:26