Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
715 views
in Technique[技术] by (71.8m points)

mysql - SQL Data Type to store build versions

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...