急,SQL问题 表YWLOG ID ACCNO OPTYPE 1 1111 4 2 1111 10 3 1111 11 4 2222 4 5 2222 10 6 3333 4 7 3333 10 查询:在ACCNO相同里面查询OPTYPE=10并且ID在同一个ACCNO里面是最大的ACCNO 比如上面这个表 我希望查出来的结果是 accno=2222和accno=3333 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from YWLOG awhere optype=10 and not exists(select 1 from YWLOG where id>a.id and accno=a.accno) select a.* from YWLOG join (select accno,max(id) from YWLOG a where optype=10 group by accno) b on a.accno=b.accno and a.id=b.id where a.optype=10 select a.* from YWLOG join (select accno,max(id) id from YWLOG a where optype=10 group by accno) b on a.accno=b.accno and a.id=b.id where a.optype=10 sql server 2000导入数据库只导结构不导数据如何实现? 如何改变datetime的默认格式(@sql server2008),在线等 我又来了,这次是关于物资库存盘点的统计,对高手来说很容易,谢谢 如何查出小数点后两位不为零的数据? SQL 2000的跨域调用问题 菜鸟问题,答对了就给分~~~~ 一个菜鸟问题求高手帮忙,在线等 在XP下可以正常安装SQLSERVER2000吗? 存储过程返回值类型的问题,高手帮忙啊! 求助!!!如何让SQL Server 认识双引号? 关于大表的处理方法 求一查询语句.(表内含关系的.)
where optype=10 and not exists(select 1 from YWLOG
where id>a.id and accno=a.accno)