读取表中最大值

select  top  1 CONVERT(int,  ISNULL(   REPLACE( ClientCode , '{0}' ,''),0) ) +1 as MaxValue from CRM_Client where ClientCode like '{0}%' " +
                                    "order by CONVERT(int, REPLACE( ClientCode , '{0}' ,'')) desc

 

posted @ 2020-08-03 10:47  BloggerSb  阅读(103)  评论(0编辑  收藏  举报