表的结构如下:
id name
1 smith,jhon,kudi
要求把id=1的name列出来,显示的结果如下
id name
1 smith
1 jhon
1 kudi要求:不用自定义的function
id name
1 smith,jhon,kudi
要求把id=1的name列出来,显示的结果如下
id name
1 smith
1 jhon
1 kudi要求:不用自定义的function
解决方案 »
- 手动不完全恢复数据库
- Oracle数据库访问错误
- 请问SQLPLUS中怎么得到通过数据库返回的变量,再利用这个变量创建表呢
- 新手上路求各位大侠帮助
- 谁能帮我写个RMAN备份恢复的例子,谢谢了!
- oracle9i的驱动程序是classes12.jar吗?还是什么?
- SQL存储过程转换ORACLE语句问题,3天没解决,万分感谢!
- 如何通过internet连接远程的oralce服务器啊?
- Pro c 在Oracle9.2下不能设置option
- Oracle11g_Read Commited模式下_为什么出现脏读DirtyRead
- 请教几个SQL问题?
- 在用cursor在表间迁移数万条数据时,sql已经执行完了,但pl sql块就是不能退出。
为啥不用自定义函数呢?
select T.id,
substr(T.name, 1, Instr(T.name, '.', 1) - 1) as name
from 表 t
union
select T.id,
substr(substr(T.name, Instr(T.name, '.', 1) + 1),
1,
Instr(substr(T.name, Instr(T.name, '.', 1) + 1), '.', 1) - 1) as name
from 表 t
union
select T.id,
substr(T.name, Instr(T.name, '.', 8) + 1) as name
from 表 t