select sybh,(select max(hl) from baobiao where sybh=a.sybh and ysmc='Fe') as Fe from baobiao a group by sybh;

解决方案 »

  1.   

    select a.sybh,(select max(hl) from baobiao where sybh=a.sybh and ysmc='Fe') as Fe from baobiao a group by a.sybh;
      

  2.   

    也不对,我用的是oracle数据库,提示缺少表达示
      

  3.   

    select sybh,max(hl) as Fe from baobiao 
    where ysmc='Fe' group by sybh;
      

  4.   

    select sybh,(select max(hl) from baobiao a where sybh=a.sybh and ysmc='Fe') as Fe from baobiao group by sybh;