select * from 表 t
where not exists(select 1
from 表
where catalogid=t.catalogid
and showid=t.showid
and version>t.version)
where not exists(select 1
from 表
where catalogid=t.catalogid
and showid=t.showid
and version>t.version)
解决方案 »
- 数据库错!协议流无效
- 【求解决办法】OLE DB 提供程序 'SQLOLEDB' 不包含表,怎么设置访问权限
- 請高手賜教數據查詢問題
- 求段sql查询语句~
- 遇到一个问题,请高手解答~~
- 求SQL写法 :期间范围判断重复范围 递增,连续范围叠加
- sqlserver2000修改自定义函数时发生的错误(错误3729)
- 如何向SQL SERVER2000的image数据列中写入超过20兆的数据?
- 请问oledb和odbc有什么区别?100分寻求答案!
- sql2005 安装
- ***MSSQL重大BUG***不同网段存储过程调用出现7391错误,在线死等,请高手帮忙
- 求教各位高人:(十万火急)数据库数据纪录存储问题
where not exists( select 1 from tb where catalogid=a.catalogid and showid=a.showid
and version>a.version)
where not exists(select 1
from table1
where catalogid=t.catalogid
and showid=t.showid
and version>t.version)
或者
select id=(select top 1 id from table1 b where b.version=a.version ),catalogid ,showid , max(version) from table1 a group by catalogid , showid
where not exists(
select 1 from tb
where catalogid=a.catalogid and showid=a.showid
and( version>a.version or version=a.version and id>a.id))
not exists?
select 1 from 中的1 ?初学者!