SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
select TOP 3 StateProvince, convert( decimal(10,3), (select count(*) from address where StateProvince = a.StateProvince) *100.0 / (select count(*) from address where CountryRegion='United States') ) as PopulationPersentage from address a group by StateProvince order by PopulationPersentage desc -- limit 3; -- select top 3 StateProvince, (count(*)*100)/295 as population from address where CountryRegion='United States' group by StateProvince order by population desc;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear