Thanks for your reply. Unfortunately, just to make things easier, product codes do not necessarily have 2 letters at the start:
are all examples of product ids...
I'm wondering if I should change the table:
Then the query would something like:
CREATE TABLE `catalogue` (
`prefix` VARCHAR(3) NOT NULL,
`suffix` VARCHAR(5) NOT NULL,
PRIMARY KEY(`prefix`, `suffix`)
What do you think?
SELECT `prefix`+`suffix` AS `id` FROM `catalogue` ORDER BY `prefix` AND `suffix`