Dual table explain. Is any data internally storing in dual table. Lot of users are accessing select sysdate from dual and they getting some millisecond differences. If we execute SELECT SYSDATE FROM EMP; what error will we get. Why

Showing Answers 1 - 9 of 9 Answers

Raja

  • Mar 15th, 2005
 

select * from dual;output will be:DUMMYXIt has a field called DUMMY with a value X.When you run select sysdate from emp;You will not get any error. You will get system in all rows (as number of rows in emp table).

  Was this answer useful?  Yes

dimple

  • Sep 8th, 2005
 

hi, the sysdate is displayed irrespective of the table u r trying to select it from. The output is the same as that of using dual.

  Was this answer useful?  Yes

Ravi

  • Sep 13th, 2005
 

The output wont be same .Ideally dual has single row so when selecting sysydate you will get one row which is not the case in emp which has multiple row .

  Was this answer useful?  Yes

akebono

  • Sep 29th, 2005
 

The built-in function SYSDATE returns a DATE value containing the current date and time on your system. DUAL is built-in relation in Oracle which serves as a dummy relation to put in the FROM clause when nothing else is appropriate. For example, try "select 1+2 from dual;".So "select sysdate from EMP" won't generate the desired result.

  Was this answer useful?  Yes

santhi

  • Nov 25th, 2005
 

We won?t get any error if we select sysdate from emp table.the system date will be displayed for each row of the emp table. but if will select sysdate from dual. asingle row in which system date will be displayed

  Was this answer useful?  Yes

P.Sathe

  • Jul 19th, 2006
 

You can issue "sysdate" from any table, but the result will be as many rows as your table , that you used.

The whole idea behind using "DUAL" table is to meet the the criteria as defined by RDBMS , that you have to use "Select.. from" syntax to get the values from column.

  Was this answer useful?  Yes

Dual is a single row table in the system tablespace accessible to all the schema users. 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.
Now if we fire
sql> select sysdate from emp;

SYSDATE
----------
24/08/2009
24/08/2009
24/08/2009

It will show sysdate as many times as there are no of rows in the table. It wont throw any row. Thats why there is a dual table in Oracle for such kind of Selects.

Keep Smilin...
Rajesh


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions