所以我使用的 SQL Server 有两个列,名为 City 和 Population。如何找到人口最多的城市的名称(语法上)?我听说 SQL Server 与 MySQL 有点不同。
当前代码:
Select MAX(Population) from City
最佳答案
在这种情况下,T-SQL 和 MySQL 之间的代码非常相似。
还有其他可行的方法,但根据您已编写的代码,这可能是最容易理解的方法。
select
city,
population
from
city
where
population = (
select max(population) from city
)
关于sql - 如何在 SQL Server(Express 版)中获取人口最多的城市?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51115903/