Skip to main content

Posts

Showing posts from May, 2015

Simple SQLPLUS formatting

> SQL Prompt>SET SQLPROMPT "My SQL Prompt>" > My SQL Prompt>SET COLSEP "|" > My SQL Prompt>SET UNDERLINE "-" > My SQL Prompt>SET LINESIZE 2000 > My SQL Prompt>SET PAGESIZE 1000 > My SQL Prompt>Select tbl2.* > 2 From (Select * > 3 From (Select 1 a, > 4 2 b, > 5 3 c, > 6 4 d, > 7 5 e > 8 From DUAL) tbl1) tbl2 > 9 Where a=b-1; > > A| B| C| D| E > ---------|---------|---------|---------|--------- > 1| 2| 3| 4| 5 > > 1 row selected. >

DUAL Table

The DUAL table was created by  Charles Weiss  of  Oracle Corporation  to provide a table for joining in internal  views : 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 inside a view that was expected to be queried. The idea was that you could do a JOIN to the DUAL table and create two rows in the result for every one row in your table. Then, by using GROUP BY, the resulting join could be summarized to show the amount of storage for the DATA extent and for the INDEX extent(s). The name, DUAL, apt for the process of creating a pair of rows from just one. [1] The original DUAL table had two rows in it (hence its name), but subsequently it only had one row. Optimization Beginning with 10g Release 1 Oracle Database have been OPTIMIZED [2]  and the database no longer performs physical or logical IO on the DUAL table even though the DUAL table still actually exists...