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
sql语句case when会报case关键字的错误
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
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解决 无用评论 打赏 举报