views:

54

answers:

2

What data type should i use for a SQL column to store Product version eg.

Version
0.1
0.1.1
0.2
1.1
1.1.647
2.0
.....

In query i should be able to sort them based on version number and i want an optimal query to find highest number.

Thanks

+3  A: 

I would consider storing each part of the number in a separate TINYINT/SMALLINT field.

Mchl
+3  A: 

Perhaps have three or four numeric fields to the version table:

Major, Minor, Revision, Build
Oded