0
Update [E1$] 
set [LR/Virtual/MW]='LR' ,  
[Vir No#]=null  
where [Conc] , [Vir No#]
  in   (    
    SELECT  [Conc] , [Vir No#]
    FROM [E1$]  
    where [Vir No#] is not null 
    group by Conc , [Vir No#] 
    having  Count(LR)<28
) 
4

3 回答 3

2

尝试这个:

    Update E set [LR/Virtual/MW]='LR' , [Vir No#]=null  
  from [E1$] E join
       (SELECT  [Conc] , [Vir No#]
        FROM [E1$] where [Vir No#] is not null 
        group by Conc ,[Vir No#] 
        having  Count(LR)<28
       ) a
 on e.[Conc]=a.[Conc] 
    and e.[Vir No#]=a.[Vir No#]
于 2012-08-08T12:55:00.340 回答
0
Update [E1$] 
set [LR/Virtual/MW]='LR',[Vir No#]=null  
where exists(    
    SELECT  [Conc] , [Vir No#]
    FROM [E1$] e2 
    where [Vir No#] is not null and  [E1$].[Conc]=e2.[Conc] and [E1$].[Vir No#]=e2.[Vir No#]
    group by Conc , [Vir No#] 
    having  Count(LR)<28
) 
于 2012-08-08T12:57:20.633 回答
0

尝试([conc], [Vir No#])where子句中使用括号。

Update [E1$] 
set [LR/Virtual/MW]='LR' ,  
[Vir No#]=null  
where ([Conc] , [Vir No#]) in
(    
   SELECT  [Conc] , [Vir No#]
   FROM [E1$]  
   where [Vir No#] is not null 
   group by Conc , [Vir No#] 
   having  Count(LR)<28
) 
于 2012-08-08T12:54:42.060 回答