What is dual table in Oracle?

Dual:

   v DUAL is a table automatically created by oracle database along with the data dictionary.

   v Dual is the schema of the user sys but is accessible by the name DUAL to all users.

   v It has only one column, DUMMY, defined by varchar2(1), and contains one row with a value X.

     Select * from Dual;

DUMMY

X

   v Selecting from the dual table is useful for computing a constant expression with the select statement. Because Dual has only one row, the constant is returned only once.

Example: 1

Computation operation:

    Select 5+5 from Dual;

Output:

5+5

10

Example: 2

   Select (500*2*10.5)/100 result from Dual;

Output:

RESULT

105

Find the user:

          Select user from dual;

    Output:

USER

APPS

 Find current date:

       Select sysdate from dual;

How can you print string in the pyramid structure?

  1. SELECT ROWNUM, SUBSTR(‘Oracle’, 1, rownum), SUBSTR(‘Oracle’, ROWNUM)

    FROM DUAL

    CONNECT BY LEVEL <= LENGTH (‘Oracle’);

Output:








Share:

No comments:

Post a Comment

Popular Posts

Search This Blog

Powered by Blogger.

Blog Archive

Service Support

Need our help to Learn or Post New Concepts Contact me

Blog Archive

Recent Posts

Service Support

Need our help to Learn or Post New Concepts Contact me