Interesting. I use enum quite a bit. So the other option as a substitution to ENUM is TINYINT?
I can definitely update the table I’m discussing, as it has zero rows. But I have some tables with 150,000 rows with 2 option to 20 option enum columns.
CREATE TABLE mod_ff
( …
, mid_id INTEGER
, status TINYINT
, …
, CONSTRAINT validstatus
FOREIGN KEY ( status )
REFERENCES statuses ( status )
);
SELECT s.statusname
, COUNT(*) AS totalcount
FROM mod_ff
INNER
JOIN statuses AS s
ON s.status = mod_ff.status
WHERE mod_ff.mod_id = $modid
GROUP
BY s.statusname
ORDER
BY s.statusname ASC
[/code]
the FK ensures that you will never have an invalid status in the mod_ff table