文件名称:缺省选项-SQL语言基础
文件大小:5.26MB
文件格式:PPT
更新时间:2024-05-15 13:25:08
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.