Home » RDBMS Server » Server Administration » dual
dual [message #374180] Tue, 29 May 2001 12:50 Go to next message
theresia
Messages: 9
Registered: May 2001
Junior Member
I used the syntax 'desc dual' in SQL PLUS and found that the dual table contains only one field named
as DUMMY and the type as varchar2(1).
And while issuing select * from dual the foll
output was seen
D
--
X

My doubt is how is it when the table is designed
in the above manner i am able to fetch a lot
of details from the dual table like
SELECT SYSDATE FROM DUAL, etc.

Could someone explain the above concept?
Re: dual [message #374181 is a reply to message #374180] Tue, 29 May 2001 13:36 Go to previous message
Jon
Messages: 483
Registered: May 2001
Senior Member
DUAL is, as you found out, a single-row table. SELECTing SYSDATE from DUAL will therefore return one row, just as selecting SYSDATE from a five-row table would return five sysdates, and selecting 'X' from a five-thousand row table would return five-thousand X's. In other words, DUAL functions just like any other table as far as selecting SYSDATE goes.

Try the following:
select sysdate from dual where dummy = 'X';
select sysdate from dual where dummy = 'Y';
Previous Topic: Difference between Select Decode.... and Select Replace...
Next Topic: two doubt in internet address
Goto Forum:
  


Current Time: Wed Jul 03 17:57:59 CDT 2024