读取表中最大值

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
原文地址:https://www.cnblogs.com/shy1766IT/p/13425016.html