简体   繁体   中英

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'

Above is the column(Comments) which contains data, Any idea on how to extract the Name(Andrew Cribbs)

In Oracle can you use this script that use ":" and "," as separators:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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