混淆SQL数据类型以选择列 [英] Confusing SQL Datatype to choose for Column

查看:85
本文介绍了混淆SQL数据类型以选择列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好......

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, use decimal and numeric to store tagval - decimal and numeric[^].


这篇关于混淆SQL数据类型以选择列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆