9*9乘法口決pl/sql的多種方法實現(一句sql實現)
select r1 || '*' || r1 || '=' || r1 * r1 A,
decode(r2, '', '', r2 || '*' || r1 || '=' || r2 * r1) b,
decode(r3, '', '', r3 || '*' || r1 || '=' || r3 * r1) C,
decode(r4, '', '', r4 || '*' || r1 || '=' || r4 * r1) D,
decode(r5, '', '', r5 || '*' || r1 || '=' || r5 * r1) E,
decode(r6, '', '', r6 || '*' || r1 || '=' || r6 * r1) F,
decode(r7, '', '', r7 || '*' || r1 || '=' || r7 * r1) G,
decode(r8, '', '', r8 || '*' || r1 || '=' || r8 * r1) H,
decode(r9, '', '', r9 || '*' || r1 || '=' || r9 * r1) I
from (select level r1,
lag(level, 1) over(order by level) r2,
lag(level, 2) over(order by level) r3,
lag(level, 3) over(order by level) r4,
lag(level, 4) over(order by level) r5,
lag(level, 5) over(order by level) r6,
lag(level, 6) over(order by level) r7,
lag(level, 7) over(order by level) r8,
lag(level, 8) over(order by level) r9
from dual
connect by level < 10)
decode(r2, '', '', r2 || '*' || r1 || '=' || r2 * r1) b,
decode(r3, '', '', r3 || '*' || r1 || '=' || r3 * r1) C,
decode(r4, '', '', r4 || '*' || r1 || '=' || r4 * r1) D,
decode(r5, '', '', r5 || '*' || r1 || '=' || r5 * r1) E,
decode(r6, '', '', r6 || '*' || r1 || '=' || r6 * r1) F,
decode(r7, '', '', r7 || '*' || r1 || '=' || r7 * r1) G,
decode(r8, '', '', r8 || '*' || r1 || '=' || r8 * r1) H,
decode(r9, '', '', r9 || '*' || r1 || '=' || r9 * r1) I
from (select level r1,
lag(level, 1) over(order by level) r2,
lag(level, 2) over(order by level) r3,
lag(level, 3) over(order by level) r4,
lag(level, 4) over(order by level) r5,
lag(level, 5) over(order by level) r6,
lag(level, 6) over(order by level) r7,
lag(level, 7) over(order by level) r8,
lag(level, 8) over(order by level) r9
from dual
connect by level < 10)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7607759/viewspace-22218/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 9*9乘法口決pl/sql的多種方法實現(pl/sql實現)SQL
- 一句SQL實現輸出九九乘法表SQL
- 【轉載】—— SQL寫的9×9乘法表SQL
- Scala實現乘法口訣
- Java 實現單例模式的 9 種方法Java單例模式
- 用SQL實現99乘法表SQL
- 實現PL/SQL的版本控制-SVNSQL
- C#版--9*9乘法口訣表C#
- 實現單例模式的 9 種方法,你知道幾種?單例模式
- Verilog乘法的實現——幾種使用多級流水實現方法對比(2)
- 大資料實現商業價值的9種方法大資料
- 實現累加的經典sql方法SQL
- sql行列轉置的實現方法SQL
- Sql字串分組Split函式的兩種實現方法SQL字串函式
- PL/SQL的每天一句話SQL
- 一句話得到 SQL 難實現的去年同期比SQL
- 利用python列印實現九九乘法口訣表Python
- Oracle SQL實現階乘的幾個方法OracleSQL
- PHP列印9*9的乘法表PHP
- PL/SQL初學者必讀:幾十個實用的PL/SQL (轉)SQL
- sql 函式實現三種父子遞迴SQL函式遞迴
- 巧妙方法教你實現多種main()AI
- Awk 陣列排序多種實現方法陣列排序
- SQL多個表實現聯合查詢SQL
- AWR TOP SQL實現SQL
- SQL Server資料庫的簡單實現方法SQLServer資料庫
- PL/SQL 批次Bind Forall 的效能表現SQL
- 用sql實現的n王后SQL
- 在Oracle 9ias中的pl/sql包的訪問控制(轉)OracleSQL
- 【SQL】9 SQL INSERT INTO 語句SQL
- Java多執行緒【三種實現方法】Java執行緒
- pl/sql--動態SQL常用方法SQL
- PowerBuilder 9實現FLASH動畫播放(轉)UI動畫
- Lumen 實現 SQL 監聽SQL
- 用pandas實現SQL功能SQL
- SQL實現分組limitSQLMIT
- Kafka - SQL 程式碼實現KafkaSQL
- Kettle實現動態SQLSQL