当前位置:Gxlcms > 数据库问题 > SQL Cookbook:使用字符串

SQL Cookbook:使用字符串

时间:2021-07-01 10:21:17 帮助过:18人阅读

select substr(e.ename, iter.pos, 1) as C 2 from (select ename from emp where ename = KING) e, 3 (select id as pos from t10) iter 4 where iter.pos <= length(e.ename);

t10中有十条数据,id从1-10。

from子句提供了笛卡尔积,结果表类似于下图

技术分享

where子句限制pos范围。

 

SQL Cookbook:使用字符串

标签:style   范围   pre   使用   结果   bst   操作   sub   span   

人气教程排行