lsgtechuser
Programmer
the table i have is setup with the following fields DemoGraphCol1, Location...
Values for DemoGraphCol1 are codes for age ranges
25to35, 35to45, 45to55 and 55andolder
lets say the location column has a list of towns
TownA,TownB,TownC etc...
I'm trying to make a query that will give a count grouped by Location and DemoGraphCol1 and show the count, but will also show the percentage in another column of the total people in that given location.
Getting the group by is straight forward, i'm just trying to get the percentage in the query as well.
select location, demographcol1,count(*), (percentage_of_totalhere) from mytable
group by location, demographcol1
Values for DemoGraphCol1 are codes for age ranges
25to35, 35to45, 45to55 and 55andolder
lets say the location column has a list of towns
TownA,TownB,TownC etc...
I'm trying to make a query that will give a count grouped by Location and DemoGraphCol1 and show the count, but will also show the percentage in another column of the total people in that given location.
Getting the group by is straight forward, i'm just trying to get the percentage in the query as well.
select location, demographcol1,count(*), (percentage_of_totalhere) from mytable
group by location, demographcol1