This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with v as (select origin a ,destination b from network_table | |
| union all | |
| select destination,origin from network_table | |
| ) | |
| ,v1 as ( | |
| select distinct a,b | |
| from v | |
| start with a=11 | |
| connect by nocycle prior b = a | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SQL> ; | |
| 1 with v as (select origin a, destination b, '->' direction from network_table | |
| 2 union all | |
| 3 select destination a, origin b, '<-' direction from network_table | |
| 4 ) | |
| 5 ,v1 as ( | |
| 6 select distinct a,direction, b | |
| 7 from v | |
| 8 start with a=24 | |
| 9 connect by nocycle prior b = a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with v as (select/*+ inline */ * | |
| from ( | |
| select origin a ,destination b from network_table | |
| union all | |
| select destination,origin from network_table | |
| ) | |
| ) | |
| ,v1 as ( | |
| select/*+ merge(v) inline */ | |
| distinct a,b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Plan hash value: 3545196243 | |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| | Id | Operation | Name | Starts | E-Rows |E-Bytes|E-Temp | Cost (%CPU)| E-Time | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem | | |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| | 0 | SELECT STATEMENT | | 1 | | | | 1734 (100)| | 10 |00:00:00.01 | 36 | | | | | |
| | 1 | HASH UNIQUE | | 1 | 6 | 78 | | 1734 (1)| 00:00:21 | 10 |00:00:00.01 | 36 | 2441K| 2441K| 1105K (0)| | |
| |* 2 | VIEW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Plan hash value: 970741584 | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| | Id | Operation | Name | E-Rows |E-Bytes|E-Temp | Cost (%CPU)| E-Time | OMem | 1Mem | Used-Mem | | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| | 0 | SELECT STATEMENT | | | | | 1734 (100)| | | | | | |
| | 1 | HASH UNIQUE | | 6 | 78 | | 1734 (1)| 00:00:01 | 2442K| 2442K| 1105K (0)| | |
| |* 2 | VIEW | | 6 | 78 | | 1733 (1)| 00:00:01 | | | | | |
| | 3 | UNPIVOT | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set echo on feed on timing on serverout off; | |
| drop table network_table purge; | |
| create table network_table ( | |
| origin number | |
| , destination number | |
| ) | |
| / | |
| begin | |
| insert into network_table values (11, 12); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SQL> select * from table(dbms_xplan.display('','','typical +adaptive')); | |
| PLAN_TABLE_OUTPUT | |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
| Plan hash value: 970741584 | |
| -------------------------------------------------------------------------------------------------------------------------------- | |
| | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | | |
| -------------------------------------------------------------------------------------------------------------------------------- | |
| | 0 | SELECT STATEMENT | | 6 | 78 | | 1734 (1)| 00:00:01 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with | |
| function cx(x int) return float deterministic as | |
| begin | |
| return -2.2 + 0.031 * x; | |
| end; | |
| function cy(y int) return float deterministic as | |
| begin | |
| return -1.5 + 0.031 * y; | |
| end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with v(name,points,votes) as ( | |
| select 'Sean Stuber' , 230, 57 from dual union all | |
| select 'Matthias Rogel' , 40, 22 from dual union all | |
| select 'Erik Van Roon' , 0, 24 from dual union all | |
| select 'Emrah Mete' , 920, 120 from dual union all | |
| select 'Sayan Malakshinov',1090, 161 from dual union all | |
| select 'Kim Berg Hansen' , 140, 48 from dual union all | |
| select 'Justin Cave' , 110, 35 from dual union all | |
| select 'Stew Ashton' , 80, 26 from dual | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| REM ######################################################################## | |
| REM # (@)sql.bat | |
| REM # | |
| REM # Copyright 2014 by Oracle Corporation, | |
| REM # 500 Oracle Parkway, Redwood Shores, California, 94065, U.S.A. | |
| REM # All rights reserved. | |
| REM # | |
| REM # This software is the confidential and proprietary information | |
| REM # of Oracle Corporation. |