I have this table in 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`)
);
I add in a record.
insert into numbering (document_type, current_no, next_no, pattern_name) values ('CUST_INV_NUM', 0, 1, 'INV');`
and i try to retrieve a value by doing:
select (pattern_name + '-' + next_no)
from numbering
where document_type = 'CUST_INV_NUM';`
I get value 1 returned. I am expecting INV-1 how do i do it?