DROP TABLE IF EXISTS ids;
CREATE TABLE ids (
id MEDIUMINT UNSIGNED,
value MEDIUMINT UNSIGNED,
KEY (id, value)
);
INSERT INTO ids VALUES ( 1, 1);
INSERT INTO ids VALUES ( 2, 2);
INSERT INTO ids VALUES ( 4, 3);
INSERT INTO ids VALUES ( 8, 4);
INSERT INTO ids VALUES (16, 5);
INSERT INTO ids VALUES (32, 6);
INSERT INTO ids VALUES (64, 7);
INSERT INTO ids VALUES (128, 8);
SELECT * FROM ids;
id	value
1	1
2	2
4	3
8	4
16	5
32	6
64	7
128	8
SELECT * FROM ids WHERE id BETWEEN 4 AND 32;
id	value
4	3
8	4
16	5
32	6
DROP TABLE ids;
