我在Oracle中可以这样查询到最新的一笔记录,  我SQL2005也有这样的记录,请问各位大侠,我的语句应该如何转换 才能达到Oracle的查询结果一样?select * from (
                select bom.bomid, bb.bomname,cs.lastchangedate
                  from changestatus cs , bom, bombase bb 
                 where cs.parentid = bb.revofrcdid 
                    and bom.bombaseid = bb.bombaseid
                    and bom.status = '1' 
                    order by cs.lastchangedate desc) aa
where rownum<2继续帮助,在这里谢谢各位大侠先!

解决方案 »

  1.   

    select bom.bomid, bb.bomname,cs.lastchangedate 
    from changestatus cs , bom, bombase bb 
    where cs.parentid = bb.revofrcdid 
    and bom.bombaseid = bb.bombaseid 
    and bom.status = '1' 
    where cs.lastchangedate=(select max(lastchangedate) from changestatus 
    where parentid=cs.parentid)
      

  2.   

    select bom.bomid, bb.bomname,cs.lastchangedate 
    from changestatus cs , bom, bombase bb 
    where cs.parentid = bb.revofrcdid 
    and bom.bombaseid = bb.bombaseid 
    and bom.status = '1' 
    and cs.lastchangedate=(select max(lastchangedate) from changestatus 
    where parentid=cs.parentid)
      

  3.   

    select top 1 bom.bomid, bb.bomname,cs.lastchangedate 
                      from changestatus cs , bom, bombase bb 
                    where cs.parentid = bb.revofrcdid 
                        and bom.bombaseid = bb.bombaseid 
                        and bom.status = '1' 
                        order by cs.lastchangedate desc