如果 LaborCostId 只有 1 行,我想输入一个新行。如果有两行,则忽略

I am wanting to enter a new row if there is only 1 row for a LaborCostId. If there are two rows, then ignore

我有一个 table,其中包含多个列,如下所示。我想写一个 UPDATE 语句来安排只在 LaborCostID 只出现一次时插入一个新行。此新行将包含与单行项目相同的 LaborCostID。如果 LaborCostID 有两行,我想忽略它。因此,对于下面的示例,我需要插入一个新行 (LaborCostID = 181614, CostCode = 'Regular Benefits', Cost = 11.946)

谢谢,我想出了一个帮助我得到它的 Where 语句。 select * 来自 azteca.LABORCOSTACTDETAIL t1 其中 LABORCOSTID 在(Select * 来自 (Select 劳动成本 来自 azteca.LABORCOSTACTDETAIL 按 LABORCOSTID 分组 计数(azteca.LABORCOSTACTDETAIL.LABORCOSTID) = 1) 作为一个);