【轉載】—— SQL寫的9×9乘法表
前些天在ITPUB論壇上看到的一個9×9乘法表,覺得不錯。特意轉載到這裡。
select
max(case when a < 1 then '' else '1*'+cast(a as varchar)+'='+cast(a*1 as varchar) end) as [1],
max(case when a < 2 then '' else '2*'+cast(a as varchar)+'='+cast(a*2 as varchar) end) as [2],
max(case when a < 3 then '' else '3*'+cast(a as varchar)+'='+cast(a*3 as varchar) end) as [3],
max(case when a < 4 then '' else '4*'+cast(a as varchar)+'='+cast(a*4 as varchar) end) as [4],
max(case when a < 5 then '' else '5*'+cast(a as varchar)+'='+cast(a*5 as varchar) end) as [5],
max(case when a < 6 then '' else '6*'+cast(a as varchar)+'='+cast(a*6 as varchar) end) as [6],
max(case when a < 7 then '' else '7*'+cast(a as varchar)+'='+cast(a*7 as varchar) end) as [7],
max(case when a < 8 then '' else '8*'+cast(a as varchar)+'='+cast(a*8 as varchar) end) as [8],
max(case when a < 9 then '' else '9*'+cast(a as varchar)+'='+cast(a*9 as varchar) end) as [9]
from (
select 1 as a
union all
select 2
union all
select 3
union all
select 4
union all
select 5
union all
select 6
union all
select 7
union all
select 8
union all
select 9
) as t1
group by a
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14321372/viewspace-571175/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PHP列印9*9的乘法表PHP
- 【中亦安圖】SQL優化之基於SQL特徵的改寫(9)SQL優化特徵
- oracle 9i 獲取sql執行計劃(書寫長的sql)OracleSQL
- SQL乘法表SQL
- 9*9乘法口決pl/sql的多種方法實現(pl/sql實現)SQL
- 【SQL】9 SQL INSERT INTO 語句SQL
- 9*9乘法口決pl/sql的多種方法實現(一句sql實現)SQL
- 轉載---IDirect3DDevice9::Reset 失敗的原因3Ddev
- display_cursor_9i.sqlSQL
- oracle9i SQL ScriptsOracleSQL
- [轉載] Oracle9i RAC 手工新增節點Oracle
- 在Oracle 9ias中的pl/sql包的訪問控制(轉)OracleSQL
- 9/9
- 專案辦公室的概念(9)(轉)
- 9、SetBackgroundEffect函式 (轉)函式
- 手動建立 Oracle9i 資料庫(轉載)Oracle資料庫
- 寫在9月1日-JavaJava
- SQL入門之9使用defaultSQL
- ORACLE 9I TURNING SQLOracleSQL
- 學習筆記----一句SQL語句寫個乘法表筆記SQL
- Oracle9i的簡化SQL語法OracleSQL
- 9 Role Transitions 角色轉換
- Oracle 9 手工建庫(轉)Oracle
- WaveMetrics Igor Pro 9 破解下載「WaveMetrics Igor Pro 9 金鑰」Go
- 用SQL實現99乘法表SQL
- Android 9 Activity的載入和顯示Android
- Ribbon 支援的9大負載均衡策略負載
- [轉載]Oracle 9i和10G軟體及補丁下載地址Oracle
- 一次捕獲SQL調優資訊的指令碼 sql9.sqlSQL指令碼
- WINDOWS9x 的後臺程式 (轉)Windows
- 談談redhat9 KDE的漢化(轉)Redhat
- NeHe的opengl教程delphi版(9)----星星 (轉)
- Oracle初學者問題9(轉)Oracle
- Oracle9i 分割槽(轉)Oracle
- JBuilder 9 常見快捷鍵(轉)UI
- Redhat9上配置DNS(轉)RedhatDNS
- 在 Red Hat Linux 9 上安裝 Oracle9i Database(轉)LinuxOracleDatabase
- 9