Reputation: 419
What should I use as mysql column type for a value that can either be 0, 1, 2 or , 3?
Upvotes: 1
Views: 488
Reputation: 434665
If space isn't tight (and it rarely is these days), I'd just use int
and move on to more interesting things. If space is tight, then a tinyint
(one byte) would make sense. The numeric types with their ranges and storage requirements is here:
An enum
might be an option:
Upvotes: 2
Reputation: 18833
I would use tinyint(1)... and I have to type more cause SO requires at least 30 characters
Upvotes: 0