混淆SQL数据类型以选择列 [英] Confusing SQL Datatype to choose for Column
问题描述
你好......
i想要创建一个名为'caustic_batch_tank'的桌子
包含以下栏目
1.empcode varchar(50)
2.shiftid int
3.edatetime datetime
4。 tagval
i希望将数据类型分配给4.tagval为十进制,但tagval列的浮点可能在单位上,十地方,百位,千位,千位等
i曾经使用浮动,但它不再起作用了。
plz帮帮我。
标签价值
0.235,
256.368,
7856.3698,
2.3698,
12.258,
123.1
等
hello...
i want to create a table named 'caustic_batch_tank'
containing following columns
1.empcode varchar(50)
2.shiftid int
3.edatetime datetime
4.tagval
i want to assign datatype to 4.tagval to decimal but the floating-point of tagval column may be on unit place,tenth place, hundred place,thousand place,thenth thousand place etc.
i had used float but it didn't work any more.
plz help me.
values for tagval
0.235,
256.368,
7856.3698,
2.3698,
12.258,
123.1
etc
推荐答案
如果你需要更高的精度,使用decimal
和numeric
来存储tagval - 十进制和数字 [ ^ ]。
If you need more precision, usedecimal
andnumeric
to store tagval - decimal and numeric[^].
这篇关于混淆SQL数据类型以选择列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!