0
我需要這兩個SQL腳本爲一體的:讓每個城市的客戶量和從AdventureWorks數據庫的總每個國家的負荷消費的獲取每個城市的客戶量和總每個國家的costumer一個表
我幾乎做到這一點,問題是我需要製作一個TABLE
,在Multiple COUNT
的問題上。
USE AdventureWorks2014
SELECT person.Address.City, Count (*) AS Total
FROM person.Address
INNER JOIN person.StateProvince
ON person.Address.StateProvinceID = person.StateProvince.StateProvinceID
GROUP BY person.Address.City
ORDER BY Total DESC
USE AdventureWorks2014
SELECT person.StateProvince.CountryRegionCode, Count (*) AS Total
FROM person.Address
INNER JOIN person.StateProvince
ON person.Address.StateProvinceID = person.StateProvince.StateProvinceID
GROUP BY person.StateProvince.CountryRegionCode
ORDER BY Total DESC
你應該顯示你想要的結果。 –
讓我編輯它,然後 –