-
在SQL语言基础中插入特定值
资源介绍
插入特殊的值
*
SQL> INSERT INTO emp (empno, ename, job,
2 mgr, hiredate, sal, comm,
3 deptno)
4 VALUES (7196, 'GREEN', 'SALESMAN',
5 7782, SYSDATE, 2000, NULL,
6 10);
1 row created.
SYSDATE函数取出当前的日期的时间.
*
INSERT INTO emp (empno, ename, job,mgr, hiredate, sal, comm,deptno)
VALUES (7196, 'GREEN', 'SALESMAN',7782, SYSDATE, 2000, NULL, 10);
Inserting Special Values by Using SQL Functions
You can use pseudocolumns to enter special values in your table.
The slide example records information for employee Green in the EMP table. It supplies the current date and time in the HIREDATE column. It uses the SYSDATE function for current date and time.
You can also use the USER function when inserting rows in a table. The USER function records the current username.
Confirming Additions to the Table
SQL> SELECT empno, ename, job, hiredate, comm
2 FROM emp
3 WHERE empno = 7196;
EMPNO ENAME JOB HIREDATE COMM
--------- ---------- --------- --------- ---------
7196 GREEN SALESMAN 01-DEC-97
- 上一篇: 很详细的端口映射教程
- 下一篇: 键盘码映射-GetKeyCode