2 ms·
Number types are meant to store numbers, not text. Even if you know the text will be just a subset of the alphabet (just 0-9) it is not a number. Just a couple
by bprieto 15y ago
Number types are meant to store numbers, not text. Even if you know the text will be just a subset of the alphabet (just 0-9) it is not a number.
Just a couple of problems: some day in the future the field could need another character beyond 0-9. In Spain National Identity Numbers were once just numbers, but they changed and added a letter for validation. If you had stored this as a number you would need to change data types, and suffer a massive application update.
Another problem: if you order a number field you get something like 1, 5, 100, 2000. But if you order a text field you would get 1, 100, 2000, 5. It's not nice to get the "number" order when you are expecting a "text" order.