select a.*
from f_ss a 
where A is not null and Aa=10
      and 检查序号 in ( select max(检查序号) as 检查序号
                        from f_ss
                        group by 序号
                      )
 

解决方案 »

  1.   

    Select *
    FROM f_ss as a
    WHERE a.aa = 10
          and a.a not is null
    and  a.检查序号 = ( Select max(b.检查序号) FROM f_ss  as b where a.序号 = b.序号)
      

  2.   

    谢谢,有谁知道group by 的用法,为什么如下语句不正确:select * from f_ss where A is not null group by 序号以下也不对:select 序号,检查序号 from f_ss where A is not null group by 序号楼上,再晚点结分!
      

  3.   

    使用了 group by 后 select 后的 就只能是 group by 中的內容和
    巨集列了
      

  4.   

    select后面加的字段,必须是Group By中列出的,或者是Sum、Count、Avg、Max、Min等聚合函数中是用的