简体   繁体   English

SQL , 从列中提取特定数据

[英]SQL , Extracting a particular data from a column

Comments注释


'teacherName: Andrew Cribbs, comment: No level change chosen by the trainer' 'teacherName: Andrew Cribbs, comment: No level change chosen by the trainer' 'teacherName: Andrew Cribbs, comment: No level change chosen by the trainer' 'teacherName:Andrew Cribbs,评论:培训师未选择级别更改''teacherName:Andrew Cribbs,评论:培训师未选择级别更改''teacherName:Andrew Cribbs,评论:培训师未选择级别更改'

Above is the column(Comments) which contains data, Any idea on how to extract the Name(Andrew Cribbs)以上是包含数据的列(评论),关于如何提取名称的任何想法(Andrew Cribbs)

In Oracle can you use this script that use ":" and "," as separators:在 Oracle 中,您可以使用这个使用“:”和“,”作为分隔符的脚本:

SELECT regexp_substr(regexp_substr('teacherName: Andrew Cribbs, comment: No level change chosen by the trainer', '[^:]+', 1, 2), '[^,]+', 1, 1)
    AS teachername
  FROM dual;

Thank you谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM