Home  >  Article  >  Database  >  Oracle的dual表作用

Oracle的dual表作用

WBOY
WBOYOriginal
2016-06-07 16:55:471057browse

1、查看当前用户,可以在 SQL Plus中执行下面语句select user from dual;2、用来调用系统函数select to_char(sysdate,

1、查看当前用户,可以在 SQL Plus中执行下面语句

select user from dual;

2、用来调用系统函数

select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;——获得当前系统时间

select SYS_CONTEXT('USERENV',,'TERMINAL') from dual;——获得主机名

select SYS_CONTEXT('USERENV','language') from dual;——获得当前locale

select dbms_random.random from dual;——获得一个随机数

3、得到序列的下一个值或当前值,用下面语句

select your_sequence.nextval from dual;——获得序列your_sequence的下一个值

select your_sequence.currval from dual;——获得序列your_sequence的当前值

4、可以用做计算器

select 7*9 from dual;

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn