<p>I've heard people referring to this table and was not sure what it was about.</p>

[{'answer_id': 73760, 'author': 'Jorge Ferreira', 'author_id': 6508, 'author_profile': 'https://Stackoverflow.com/users/6508', 'pm_score': 5, 'selected': False, 'text': '<p>I think this wikipedia article may help clarify.</p>\n\n<p><a href="http://en.wikipedia.org/wiki/DUAL_table" rel="noreferrer">http://en.wikipedia.org/wiki/DUAL_table</a></p>\n\n<blockquote>\n  <p>The DUAL table is a special one-row\n  table present by default in all Oracle\n  database installations. It is suitable\n  for use in selecting a pseudocolumn\n  such as SYSDATE or USER The table has\n  a single VARCHAR2(1) column called\n  DUMMY that has a value of "X"</p>\n</blockquote>\n'}, {'answer_id': 73767, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<p>Kind of a pseudo table you can run commands against and get back results, such as sysdate. Also helps you to check if Oracle is up and check sql syntax, etc.</p>\n'}, {'answer_id': 73772, 'author': 'Sean McMains', 'author_id': 2041950, 'author_profile': 'https://Stackoverflow.com/users/2041950', 'pm_score': 9, 'selected': True, 'text': '<p>It\'s a sort of dummy table with a single record used for selecting when you\'re not actually interested in the data, but instead want the results of some system function in a select statement:</p>\n<p>e.g. <code>select sysdate from dual;</code></p>\n<p>See <a href="http://www.adp-gmbh.ch/ora/misc/dual.html" rel="nofollow noreferrer">http://www.adp-gmbh.ch/ora/misc/dual.html</a></p>\n<p>As of 23c, Oracle supports <code>select sysdate /* or other value */</code>, without <code>from dual</code>, as has been supported in MySQL for some time already.</p>\n'}, {'answer_id': 73787, 'author': 'Martin08', 'author_id': 8203, 'author_profile': 'https://Stackoverflow.com/users/8203', 'pm_score': 4, 'selected': False, 'text': "<p>It's the special table in Oracle. I often use it for calculations or checking system variables. For example:</p>\n\n<ul>\n<li><code>Select 2*4 from dual</code> prints out the result of the calculation</li>\n<li><code>Select sysdate from dual</code> prints the server current date. </li>\n</ul>\n"}, {'answer_id': 73793, 'author': 'mfx', 'author_id': 8015, 'author_profile': 'https://Stackoverflow.com/users/8015', 'pm_score': 7, 'selected': False, 'text': "<p>It is a dummy table with one element in it. It is useful because Oracle doesn't allow statements like</p>\n\n<pre><code> SELECT 3+4\n</code></pre>\n\n<p>You can work around this restriction by writing</p>\n\n<pre><code> SELECT 3+4 FROM DUAL\n</code></pre>\n\n<p>instead.</p>\n"}, {'answer_id': 73794, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>It's a object to put in the from that return 1 empty row. For example:\nselect 1 from dual;\nreturns 1</p>\n\n<p>select 21+44 from dual;\nreturns 65</p>\n\n<p>select [sequence].nextval from dual;\nreturns the next value from the sequence.</p>\n"}, {'answer_id': 73803, 'author': 'Sakin', 'author_id': 12818, 'author_profile': 'https://Stackoverflow.com/users/12818', 'pm_score': 2, 'selected': False, 'text': '<p>The DUAL table is a special one-row table present by default in all Oracle database installations. It is suitable for use in selecting a pseudocolumn such as SYSDATE or USER</p>\n\n<p>The table has a single VARCHAR2(1) column called DUMMY that has a value of "X"</p>\n\n<p>You can read all about it in <a href="http://en.wikipedia.org/wiki/DUAL_table" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/DUAL_table</a></p>\n'}, {'answer_id': 73816, 'author': 'Ivan Bosnic', 'author_id': 3221, 'author_profile': 'https://Stackoverflow.com/users/3221', 'pm_score': 6, 'selected': False, 'text': '<p>From <a href="http://en.wikipedia.org/wiki/DUAL_table" rel="noreferrer">Wikipedia</a></p>\n\n<p><strong>History</strong></p>\n\n<p>The DUAL table was created by Chuck Weiss of Oracle corporation to provide a table for joining in internal views:</p>\n\n<blockquote>\n  <p><em>I created the DUAL table as an underlying object in the Oracle Data Dictionary. It was never meant to be seen itself, but instead used\n  inside a view that was expected to be queried. The idea was that you\n  could do a JOIN to the DUAL table and create two rows in the result\n  for every one row in your table. Then, by using GROUP BY, the\n  resulting join could be summarized to show the amount of storage for\n  the DATA extent and for the INDEX extent(s). The name, DUAL, seemed\n  apt for the process of creating a pair of rows from just one. <a href="http://en.wikipedia.org/wiki/DUAL_table" rel="noreferrer">1</a></em></p>\n</blockquote>\n\n<p>It may not be obvious from the above, but the original DUAL table had two rows in it (hence its name). Nowadays it only has one row.</p>\n\n<p><strong>Optimization</strong></p>\n\n<p>DUAL was originally a table and the database engine would perform disk IO on the table when selecting from DUAL. This disk IO was usually logical IO (not involving physical disk access) as the disk blocks were usually already cached in memory. This resulted in a large amount of logical IO against the DUAL table.</p>\n\n<p>Later versions of the Oracle database have been optimized and the database no longer performs physical or logical IO on the DUAL table even though the DUAL table still actually exists.</p>\n'}, {'answer_id': 73899, 'author': 'steevc', 'author_id': 1895, 'author_profile': 'https://Stackoverflow.com/users/1895', 'pm_score': 2, 'selected': False, 'text': '<p>DUAL is necessary in PL/SQL development for using functions that are only available in SQL</p>\n\n<p>e.g.</p>\n\n<pre><code>DECLARE\nx XMLTYPE;\nBEGIN\nSELECT xmlelement("hhh", \'stuff\')\nINTO x\nFROM dual;\nEND;\n</code></pre>\n'}, {'answer_id': 9077985, 'author': 'Venkataramesh Kommoju', 'author_id': 229608, 'author_profile': 'https://Stackoverflow.com/users/229608', 'pm_score': 2, 'selected': False, 'text': '<p>More Facts about the DUAL....</p>\n\n<p><a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1562813956388" rel="nofollow">http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1562813956388</a></p>\n\n<p>Thrilling experiments done here, and more thrilling explanations by Tom</p>\n'}, {'answer_id': 19224594, 'author': 'AB01', 'author_id': 2568015, 'author_profile': 'https://Stackoverflow.com/users/2568015', 'pm_score': 3, 'selected': False, 'text': '<p>A utility table in Oracle with only 1 row and 1 column. It is used to perform a number of arithmetic operations and can be used generally where one needs to generate a known output.</p>\n\n<p>SELECT * FROM dual;</p>\n\n<p>will give a single row, with a single column named "DUMMY" and a value of "X" as shown here: </p>\n\n<blockquote>\n<pre><code>DUMMY\n----- \nX\n</code></pre>\n</blockquote>\n'}, {'answer_id': 25053187, 'author': 'Vishwa G', 'author_id': 3763015, 'author_profile': 'https://Stackoverflow.com/users/3763015', 'pm_score': 1, 'selected': False, 'text': "<p>DUAL we mainly used for getting the next number from the sequences.</p>\n\n<p>Syntax : SELECT 'sequence_name'.NEXTVAL FROM DUAL  </p>\n\n<p>This will return the one row one column value(NEXTVAL column name).</p>\n"}, {'answer_id': 48305056, 'author': 'Newton fan 01', 'author_id': 5600260, 'author_profile': 'https://Stackoverflow.com/users/5600260', 'pm_score': 1, 'selected': False, 'text': "<p>another situation which requires  <code>select ... from dual</code>   is when we want to retrieve the code (data definition) for different database objects (like TABLE, FUNCTION, TRIGGER, PACKAGE), using the built in <code>DBMS_METADATA.GET_DDL</code> function:</p>\n\n<pre><code>select DBMS_METADATA.GET_DDL('TABLE','&lt;table_name&gt;') from DUAL;\n\nselect DBMS_METADATA.GET_DDL('FUNCTION','&lt;function_name&gt;') from DUAL;\n</code></pre>\n\n<p>in is true that nowadays the IDEs do offer the capability to view the DDL of a table, but in simpler environments like SQL Plus this can be really handy.</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>a more general situation: basically, when we need to use any PL/SQL procedure inside a standard SQL statement, or when we want to call a procedure from the command line:</p>\n\n<pre><code>select my_function(&lt;input_params&gt;) from dual;\n</code></pre>\n\n<p>both recipes are taken from the book 'Oracle PL/SQL Recipes' by Josh Juneau and Matt Arena</p>\n"}, {'answer_id': 56107698, 'author': 'Manjunatha B', 'author_id': 3912972, 'author_profile': 'https://Stackoverflow.com/users/3912972', 'pm_score': 1, 'selected': False, 'text': '<p>The DUAL is special one row, one column table present by default in all Oracle databases. The owner of DUAL is SYS.</p>\n\n<p>DUAL is a table automatically created by Oracle Database along with the data functions. It is always used to get the operating systems functions(like date, time, arithmetic expression., etc.) </p>\n\n<pre><code>SELECT SYSDATE from dual;  \n</code></pre>\n'}]
['https://Stackoverflow.com/questions/73751', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3208/']