比如select aa from bb
aa里面顯示為1 2 3 4 5,我現在要把1 2 3 4 5換成其他內容如:氫 氦 鋰 鈹 硼 應該怎么做
uj5u.com熱心網友回復:
另外添加一列內容為天 天 天 天 天,不能使用alter table
uj5u.com熱心網友回復:
case whenuj5u.com熱心網友回復:
-----第一種方式
select Replace(Replace(aa,'1','氫'),'2','氦') as aa from bb
---第二種方式
select (case when aa = '1' then '氫' else '' end +case when aa = '2' then '氦' else '' end ) as aa from bb
---第三種方式
uj5u.com熱心網友回復:
1、用case when,如3樓
2、用臨時表join
3、用自定義函式
4、用字串定位,例如:select substring('氫氦鋰鈹硼',3,1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/152365.html
標籤:基礎類
上一篇:畫面上Radiobutton動態取得,默認第一個選項為選中狀態
下一篇:eclipse解壓了打不開
