嵌套查询Max问题?

来源:互联网 发布:钢板下料软件 编辑:程序博客网 时间:2024/06/04 18:02

在Sql Server中:

第一条语句:select max(UserId) from (select top 5 UserId from tableTest);

第二条语句:select max(a.UserId) from (select top 5 UserId from tableTest) a;

为什么第一条语句不能执行?