select yhdm as 用户代码, yhmc as 用户名称,kprq as 开票日期
from t1,(select yhdm,max(kprq) as kprq ) T1 from t1 group by yhdm
where t1.yhdm = T2.yhdm

解决方案 »

  1.   

    select yhdm as 用户代码, yhmc as 用户名称,kprq as 开票日期
    from t1,(select yhdm,max(kprq) as kprq ) T2 from t1 group by yhdm
    where t1.yhdm = T2.yhdm
      

  2.   

    select yhdm,max(kprq) as kprq后面没有from了?
      

  3.   

    select yhdm as 用户代码, yhmc as 用户名称,kprq as 开票日期
    from t1,(select yhdm,max(kprq) as kprq FROM T1  GROUP BY YHDM) T2 
     where t1.yhdm = T2.yhdm
      

  4.   

    into 写在 from 之前怎么能有两个from呢? 你应该仔细看看sql语法了
      

  5.   

    哦!呀!我都看错了!呵呵!select yhdm as 用户代码, yhmc as 用户名称,max(kprq) as 开票日期
    from t1 group by yhdm,yhmc