Dual is a virtual table that makes up the syntax rules for SELECT, and Oracle guarantees that there will always be only one record in dual. We can use it to do a lot of things, as follows:
1. To view the current user, you can execute the following statement in SQL Plus select User from dual;
2. Used to call system functions
Select To_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss ') from dual;--get current system time
Select Sys_context (' USERENV ', ' TERMINAL ') from dual;--get host name
Select Sys_context (' USERENV ', ' language ') from dual;--get current locale
Select Dbms_random.random from dual;--to get a random number
Select Concat (' 010-', ' 88888888 ') | | ' Ext. 23 ' telephone from dual;
3. Get the next value or the current value of the sequence, using the following statement
Select Your_sequence.nextval from dual;--to get the next value of the sequence Your_sequence
Select Your_sequence.currval from dual;--to get the current value of the sequence Your_sequence
4, can be used as a calculator select 7*9 from dual;
Use of pseudo-table dual in Oracle