1.清空数据表(改语句会初始化主键ID)
Truncate Table tableName
2.返回新增数据的主键ID
INSERT INTO tableName VALUES('name','sex') SELECT@@IDENTITY
3.Group by 分组统计数量
SELECT AGroundFieldName,count(AGroundFieldName) AS 数量 FROM Ground_Field GROUP BY AGroundFieldName
SELECT AGroundFieldName, ( case AIsUse when 1 then '启用' else '删除' end ) as 状态,count(AGroundFieldName) as 数量 FROM Ground_Field GROUP BY AIsUse,AGroundFieldName