DUAL Table
DUAL Table is a SQL statement in the Oracle Specific category. Oracle special one-row table used for SELECTing constants, functions, or computations without a real table. The syntax is SELECT expression FROM DUAL;. It returns expression result. A typical example: SELECT SYSDATE FROM DUAL; -- Current date SELECT 2 + 2 FROM DUAL; -- 4 SELECT UPPER('hello') FROM DUAL; -- 'HELLO' SELECT emp_id_seq.NEXTVAL FROM DUAL; -- Next sequence value -- Dual exists in Oracle and MySQL (MySQL's is implicit) A close relative is SEQUENCE (Oracle), which oracle: generates sequential numbers. Independent of tables. Accessed via NEXTVAL and CURRVAL. A close relative is ROWNUM / FETCH FIRST, which oracle: ROWNUM assigns sequential numbers to rows. Used for limiting results (pre-12c). A close relative is SYSDATE / CURRENT_DATE, which oracle: returns the current date and time of the database server. More about this category: Oracle-specific features — SEQUENCE, ROWNUM, SYSDATE, CONNECT BY, PL/SQL.