当时是添加了这段sql: ((select count(*) from (. as pre LEFT JOIN V_PigsArchives AS arc ON pre.PigsArchivesID = arc.PigsArchivesID LEFT JOIN Farm.T_Houses AS house ON house.HouseID = arc.HouseID) where pre.PregnancyTestDate between @startTime and @endTime and house.ProductionLineID = line.ProductionLineID and (pre.PregnancyTestResult = 2 or pre.PregnancyTestResult = 3 or pre.PregnancyTestResult = 4) ) / (select count(*) from (A.A as mating LEFT JOIN V_PigsArchives AS arc ON mating.PigsArchivesID = arc.PigsArchivesID LEFT JOIN Farm.T_Houses AS house ON house.HouseID = arc.HouseID) where mating.FirstMatingDate between @startTime and @endTime and house.ProductionLineID = line.ProductionLineID ))as '失配率',