我在mysql中有这个表。
CREATE TABLE `numbering` (
`numbering_id` INT(11) NOT NULL AUTO_INCREMENT,
`document_type` VARCHAR(255) NOT NULL,
`current_no` int(15) NOT NULL DEFAULT '0',
`next_no` int(15) NOT NULL DEFAULT '1',
`pattern_name` VARCHAR(255) NULL,
`created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`numbering_id`)
);我添加了一条记录。
插入编号(document_type,current_no,next_no,pattern_name)值('CUST_INV_NUM',0,1,'INV');`
我尝试通过执行以下操作来检索一个值:
select (pattern_name + '-' + next_no)
from numbering
where document_type = 'CUST_INV_NUM';`我得到返回值1。我在等待INV-1,我该怎么做?
https://stackoverflow.com/questions/51261863
复制相似问题