如何在充满数字的列中找到未使用的数字。
表_A:
'id' int(11) unsigned NOT NULL AUTO_INCREMENT,
'client_code' int(4) unsigned NOT NULL,
'client_name' varchar(50) NOT NULL,
PRIMARY KEY ('id')
INSERT INTO Table_A ('client_code','client_name') VALUES (1,'Bob');
INSERT INTO Table_A ('client_code','client_name') VALUES (2,'Anna');
INSERT INTO Table_A ('client_code','client_name') VALUES (5,'Jim');
INSERT INTO Table_A ('client_code','client_name') VALUES (6,'Tom');
INSERT INTO Table_A ('client_code','client_name') VALUES (10,'Mattew');
如果我SELECT 'client_code' FROM Table_A
输出将是1,2,5,6,10
. 我怎样才能拥有未使用的号码?
(3,4,7,8,9,11,12...)