中国开发网: 论坛: 程序员情感CBD: 贴子 368338
吴宗隆: select top 4 max(ID) as ID from MyTable
使用MAX(ID)就表示只有一条记录,所以TOP 4在这里根本没起任何作用

解决办法

select max(id) from
(select top 4 id from MyTable order by id) aa

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录