如何在SQL中的表中插入浮点值以及如何创建此表的视图 [英] How to insert a float value in a table in SQL and how to creating a view of this table
问题描述
我已经有一个名为EMP_DETAILS的表。它有3列,一个是NAME(VARCHAR2(150)),EMP_ID(NUMBERS(5,0)),另一个是SALARY(INTEGER(5,0))。我想将列SALARY的数据类型更改为FLOAT。
主键是EMP_ID。
那个写了一个查询,ALTER TABLE EMP_DETAILS MODIFY SALARY float(5,0);
当我想在这个表中插入一些值时,我没有' t插入任何值。
实际上我想知道获取浮点值的语法是什么。
注意,FLOAT
是一个具有二进制精度的浮点数,因此不能设置小数前后的位数。 br />
请参阅:
https ://docs.oracle.com/cd/B28359_01/server.111/b28285/sqlqr06.htm#CHDJJEEA [ ^ ]
http://psoug.org/definition/FLOAT.htm [ ^ ]
I already have a table whose name is EMP_DETAILS. It has 3 column, one is NAME (VARCHAR2(150)), EMP_ID(NUMBERS(5,0)) and another one is SALARY(INTEGER(5,0)). I want to alter the datatype of column SALARY to FLOAT.
Primary Key is EMP_ID.
For that t wrote a query which is, ALTER TABLE EMP_DETAILS MODIFY SALARY float(5,0);
When ever I want to insert some value into this table I didn't insert any value into this.
Actually I want to Know what is the syntax to get the float value.
Note, thatFLOAT
is a floating-point number with a binary precision, so you can't set the number of digits before and after the decimal.
See:
https://docs.oracle.com/cd/B28359_01/server.111/b28285/sqlqr06.htm#CHDJJEEA[^]
http://psoug.org/definition/FLOAT.htm[^]
这篇关于如何在SQL中的表中插入浮点值以及如何创建此表的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!