在ORACLE產生001,002的流水號


select 'I'||TO_CHAR(SYSDATE,'YYYYMMDD')||trim(to_char(to_number(nvl(max(substr(CCID,-3)),0))+1,'000'))
from ES_CC;

原文地址:https://www.cnblogs.com/buy0769/p/3944950.html