------------------------------------------
auto_id | group_id | TOF | TOF_2 |
------------------------------------------
8001 | 512 | true | |
------------------------------------------
8002 | 512 | false | |
------------------------------------------
8003 | 512 | false | |
------------------------------------------
8004 | 512 | false | |
------------------------------------------
8005 | 512 | false | |
------------------------------------------
我希望UPDATE
列TOF_2
的条件可以描述如下:如果同一group_id
的任何行显示TRUE
,则此行的所有行group_id
TRUE
FALSE
group_id
TOF_2
UPDATE table
SET TOF_2 = CASE
WHEN TOF is true THEN TOF_2 = true ELSE TOF_2 = FALSE
GROUP BY group_id
psexec.exe \\$computer -s -u Adminuser -p AdminPassword msiexec /i C:\Avamar\AvamarClient-windows-x86_64-7.0.102-47.msi /qb ADVANCED_OPTIONS=1 CHANNEL=100
{{1}} {{1}}。{/ 1}}
我认为IF或CASE可以解决问题,但我不确定正确的表达方式?
{{1}}
我知道这是错的,但可能是朝着正确的方向发展?以某种方式描述任务并不容易。
答案 0 :(得分:1)
您可以将Show Detailed Compiler Output:
C:\Program Files (x86)\IIS Express> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Web.PageInspector.Loader\v4.0_1.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Web.PageInspector.Loader.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\f1797493\0a6847cc_a781d001\MES_WebShell_Contract.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\e90790ee\6d927a72_8a81d001\WebActivatorEx.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\a12d02d2\2b7a5d18_0e5cd001\Microsoft.Practices.Unity.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\d5f7acc0\6b36ac18_0e5cd001\Microsoft.Practices.Unity.Mvc.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\3b971db3\b1f9174f_0c92cf01\Common.Library.Core.State.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\963f5834\6b345918_0e5cd001\Microsoft.Practices.Unity.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\89a8fa3f\6336b4cc_a781d001\MES_WebShell_Business.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\assembly\dl3\decdd4ca\7bae6018_0e5cd001\Microsoft.Practices.Unity.RegistrationByConvention.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\App_Code.tekse26w.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701;612;618 /warnaserror- "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\App_Code.tekse26w.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\7aca0e01\527e5722\App_Code.tekse26w.1.cs"
Microsoft (R) Visual C# Compiler version 4.0.30319.34209
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
d:\Projects\MES_FraMES\Web Applications\MES_WebShell\1\trunk\Solution\MES_WebShell\MES_WebShell\App_Code\RegisterVirtualPathProvider.cs(4,7): error CS0246: The type or namespace name 'EmbeddedResourceVirtualPathProvider' could not be found (are you missing a using directive or an assembly reference?)
Show Complete Compilation Source:
Line 1: using System.Linq;
Line 2: using System.Reflection;
Line 3: using System.Web.Hosting;
Line 4: using EmbeddedResourceVirtualPathProvider;
Line 5:
Line 6: namespace MES_WebShellLine 7: {Line 8: public class RegisterVirtualPathProviderLine 9: {Line 10: public static void AppInitialize()Line 11: {Line 12: //By default, we scan all non system assemblies for embedded resourcesLine 13: var assemblies = System.Web.Compilation.BuildManager.GetReferencedAssemblies()Line 14: .Cast<Assembly>()Line 15: .Where(a => a.GetName().Name.StartsWith("System") == false); Line 16: HostingEnvironment.RegisterVirtualPathProvider(new Vpp(assemblies.ToArray())Line 17: {Line 18: //you can do a specific assembly registration too. If you provide the assemly source path, it can readLine 19: //from the source file so you can change the content while the app is running without needing to rebuildLine 20: //{typeof(SomeAssembly.SomeClass).Assembly, @"..\SomeAssembly"} Line 21: });Line 22: }Line 23: }Line 24: }
运算符与子查询一起使用:
IN
答案 1 :(得分:0)
您可以使用EXISTS
来检查:
UPDATE a SET tof_2=true WHERE
EXISTS (SELECT 1 FROM a a1 WHERE a1.group_id=a.group_id AND tof=true);