ZJE_2011 2016-05-26 12:34 采纳率: 0%
浏览 2487

sql语句case when会报case关键字的错误

select * from shrzl a inner join
(select max(shrdh) shrdh,max(id) id from sfglb group by fhrdh)b on a.shrdh=b.shrdh
case when b.shrdh is not null then a.no=-1 end

  • 写回答

2条回答 默认 最新

  • danielinbiti 2016-05-26 13:15
    关注
     select a.*,
    case when b.shrdh is not null then -1 else a.no end ano from shrzl a inner join 
    (select max(shrdh) shrdh,max(id) id from sfglb group by fhrdh)b on a.shrdh=b.shrdh 
    
    评论

报告相同问题?