中国开发网: 论坛: 程序员情感CBD: 贴子 289281
haitao
这样。。。。
select b.* from
(
select zh,max(xh) as hz
from tb
group by zh
) a
left join tb b on a.zh=b.zh and a.xh=b.xh


下午想试sql2005的递归查询,找了半天没找到CTE的例子。。。

相关信息:


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