-
默认选项:SQL语言入门
资源介绍
缺省选项
*
… hiredate DATE DEFAULT SYSDATE, …
合法的值可以是一个直接的量、表达式、或者一个SQL函数.
缺省值的数据类型必须与列的数据类型匹配.
为某个列指定一个缺省值.
*
The DEFAULT Option
A column can be given a default value by using the DEFAULT option. This option prevents null values from entering the columns if a row is inserted without a value for the column. The default value can be a literal, an expression, or a SQL function, such as SYSDATE and USER, but the value cannot be the name of another column or a pseudocolumn, such as NEXTVAL or CURRVAL. The default expression must match the datatype of the column.
Instructor Note
Here is an example for a pseudocolumn. For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle server selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.
- 上一篇: 改变一个表中的数据-SQL语言基础
- 下一篇: 用多列子查询进行修改-SQL语言基础