Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: What is "dual"
DUAL is a small but useful Oracle table created for testing functions or doing quick calculations. DUAL is a tiny table that has only one row and one column in it, but this is irrelevant, as you do not need to know the definition of this table.
Essentially, you can think of it as a pseudo-table that exists so you can construct and issue syntactically valid SQL statements.
If I wish to see 4**3 (that is, 4 to the power of 3), I could issue the following "query":
SELECT POWER(4,3) FROM DUAL; I could just as easily have issued:
SELECT POWER(4,3) FROM SCOTT.EMP; but now, this will return me the result (in this case, 64) for as many rows exist in the SCOTT.EMP table.
It's just a convenient way to perform some calculation, often used in PL/SQL procedures and triggers, that will always return a singleton.
On Mon, 03 Feb 1997 09:58:51 -0800, Mirwais Qader <mq_at_wohl.slh.wisc.edu> wrote:
>Something that has always puzzled me is what is "dual"?
>
>I know (at least I think I do) it is a table of 1 row and 1 col, but
>how is it used and what benefit is it?
>
>Thanks for any info.
>PS. Please respond by email.
>
>-Mir.
Thanks!
Joel
Joel R. Kallman Enabling the Information Age through Oracle Government Network Computing! Bethesda, MD http://govt.us.oracle.com jkallman@us.oracle.com http://www.oracle.com