I think decimal (p, s) should be used, and s represents percentage ability. "p" can be equal to 1, since we do not need more than one byte, since each digit on the left side of the point is equal to one percent, so the value of p must be at least s + 1 so that you can store up to 1000%. but SQL does not allow 'p' to be smaller than s.
Examples: 28.2656579879% should be decimal (13, 12) and should be stored 00.282656579879 128.2656579879% should be decimal (13, 12) and 01.282656579879 should be stored
28% should be stored in decimal (3.2) as 0.28 128% should be stored in decimal (3.2) as 1.28
Note: if you know that you will not reach 100% (i.e. your value will always be less than 100% than using the decimal number (s, s), if it is, use the decimal (s + 1, s).
And so on
Shimmy Oct 21 '09 at 5:30 p.m. 2009-10-21 17:30
source share