【轉載】—— 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】9 SQL INSERT INTO 語句SQL
- 轉載---IDirect3DDevice9::Reset 失敗的原因3Ddev
- 9/9
- 9 Role Transitions 角色轉換
- 9*9的數獨(dfs)
- Rocky9 掛載磁碟
- WaveMetrics Igor Pro 9 破解下載「WaveMetrics Igor Pro 9 金鑰」Go
- Android 9 Activity的載入和顯示Android
- Ribbon 支援的9大負載均衡策略負載
- 9 SystemVerilog語言編寫SPI接收
- 9
- Axure RP 9怎麼轉換為中文
- 2024/9/9工作日誌
- iZotope Ozone 9 Pro for Mac(臭氧9)Mac
- 小米9安兔兔跑分效能測試:搭載驍龍855的小米9跑分多少?
- 從 loading 的 9 種寫法談 React 業務開發React
- 很用心的為你寫了 9 道 MySQL 面試題MySql面試題
- oeasy教您玩轉vim - 9 - # 換行插入
- Nessus Professional 10.7.5 Auto Installer for RHEL 9/AlmaLinux 9/Rocky Linux 9 (updated Jul 2024)Linux
- 4/9
- 6.17 9
- 6/9
- RHEL 9 / Rocky Linux 9 上安裝 MySQLLinuxMySql
- 1.2.3.4.5.6.7的表達(9)
- Promise 的 9 個提示Promise
- [轉載]程式設計師必備:書寫高質量SQL的30條建議程式設計師SQL
- 9.(轉)Spring Configuration Check Unmapped Spring configuration files foundSpringAPP
- 小米9 SE安兔兔跑分與效能測試:搭載驍龍712的小米9 SE跑分多少?
- 9月9日—9月15日共有48款遊戲開測|GameRes遊戲GAM
- 9K9K:2019年9月網頁遊戲資料包告網頁遊戲
- Oracle9i中v$sql、v$sqlarea、v$sqltext、v$sql_plan的聯絡與區別OracleSQL
- 9-7 ~ 9-27做論文全過程的反思
- RockyLinux9,RHEL9修改統一的網路卡名稱Linux
- NEO改進協議提案9(NEP-9)協議
- 手寫題:9道字串類高頻面試題字串面試題
- 基於 .NET 9 + K8S 寫了個 MockHttpK8SMockHTTP
- [20221015]mmon_slave sql_id=c9umxngkc3byq Automatic Report Flush.sqlSQL
- 微信小遊戲開發(9)- 分包載入遊戲開發