saleemMSMS
Registered User.
- Local time
- Tomorrow, 04:58
- Joined
- Aug 12, 2009
- Messages
- 92
consider the following table
i want to query and take the total population and the number of GNs group by the district so i wrote the following query
but now i want the percentage of population in each district.. can someone guide me towards the query? since theres a group by clause i'm unable to get the total population.. thats what is worrying.. any suggestions please ?
i want to query and take the total population and the number of GNs group by the district so i wrote the following query
Code:
SELECT District.DistrictName AS [District Name], Count(GN.GNCode) AS [Number of GNs], sum(population) AS [Total Polulation]
FROM (District INNER JOIN GN ON District.DisctrictCode=GN.DisctrictCode)
GROUP BY (District.DisctrictCode), District.DistrictName;
but now i want the percentage of population in each district.. can someone guide me towards the query? since theres a group by clause i'm unable to get the total population.. thats what is worrying.. any suggestions please ?