enter image description here请您协助使用SQL代码:
我当前执行计数(和工作)的sql代码如下所示:
SELECT DISTINCT Count(TblBusinessTerm.BusinessTerm) AS CountOfBusinessTerm,
TblField.DomainCatID,
Count(TblField.FieldID) AS CountOfFieldID
FROM TblBusinessTerm
INNER JOIN TblField ON TblBusinessTerm.BusinessTermID = TblField.BusinessTermID
GROUP BY TblField.DomainCatID;
Business of Business的值和字段ID的计数值,我需要更新到表TEMPTABLESTATS,其中BTLINK =业务术语的计数和NUMOFLINKEDFIELDS =字段ID的计数。
所以我在更新时必须工作的SQL
UPDATE TblTempStats
SET TblTempStats.EmptyBusiness_Rules =
DSum(
'IIf([Business_Rules] Is Null,1,0)',
'TblField',
IIf(
TblTempStats.DomainCatID Is Null,
'TblField.DomainCatID Is Null',
'TblField.DomainCatID = ' & TblTempStats.DomainCatID ) )
当我从没有连接的单个表填充时,哪个有效,但现在我需要从连接表中填充,
并且可以看出我的SQL并不是那么强大。
请有人协助