案例來源:PTT DATABASE版
想要知道talbe中有哪幾種副檔名
範例table (fild)如下:
name
123.abc
123tt.pwd
1ee3tt.pdf
1ezz.word
1ezzqq.ptt
1ezzqq.ptt
語法: 運用distinct +substr + instr
****************
select distinct substr(name,instr(name,'.',1),10) from fild;
其中instr(name,'.',1) 是判斷'.'在哪個位子
****************
結果:
.abc
.pwd
.ptt
.word
.pdf
文章標籤
全站熱搜
