难道数据表还要自己建立吗,不是已经给定了吗?
如果已经给定数据表,那么sun_boy后面的SELECT语句的结果不是正解吗?
Select Count(*) - 1 as ID
From T A Left Join T B on isNull(A.i, 0) >= isNull(B.i, 0)
Group by A.i
哈哈,数据表肯定建立了的啊
我只是为了方便各位测试,所以才加上建表语句和插入数据的语句哦
查询的话就这一句了
Select Count(*) - 1 as ID
From T A Left Join T B on isNull(A.i, 0) >= isNull(B.i, 0)
Group by A.i