P.Brian.Mackey
P.Brian.Mackey

Reputation: 44305

SQL - Which data type represents percentages well?

In SQL I am looking at decimal and float. Float says it is an approximation. I need to store percentages. They don't have to be very large or small. Some examples are

60.2

40

Which data type should I use?

Upvotes: 2

Views: 11503

Answers (1)

Derek
Derek

Reputation: 23318

decimal(x,y)

x is the total number of digits you want to be able to represent

y is the total number of digits after the decimal point that you want to be able to represent

Upvotes: 6

Related Questions