I have a table 'user' with 3 items.
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customernumber` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`type` enum('customer','admin') COLLATE utf8_unicode_ci NOT NULL,
How can I increment 'customernumber' with the first two letters of the 'type'?
For example, user with ID=10 and type='admin' will have a customernumber 'AD000010'. And user with ID = 12 and type = 'customer' will have a customernumber 'CU000012'?
Is this possible to do this in MySQL without using a trigger? If not, how can I do this with a trigger?