java吧 关注:1,299,202贴子:12,838,032
  • 0回复贴,共1

求助 关于sql语句

取消只看楼主收藏回复

select a.bugId from BugTrack a where delFlag='1' and exists(select 1 from BugTrack where bugId = a.bugId and delFlag='1' group by bugId having a.resolvedDate=max(resolvedDate))
select a.bugId from BugTrack a where delFlag='1' and not exists(select 1 from BugTrack where bugId = a.bugId and delFlag='1' and resolvedDate>a.resolvedDate)
这两个sql语句哪一个查询效率更高 数据非常多的情况下


IP属地:广东1楼2016-11-11 10:12回复