📅  最后修改于: 2022-03-11 15:04:54.032000             🧑  作者: Mango
SELECT CityID,
COUNT(*) NumberOfDogsInThisCity,
SUM(CASE WHEN DogName = 'Tedy' THEN Wheight ELSE 0 END) WheightOfAllDogWithNameTedy
FROM Dogs
GROUP BY CityID