mysql - Select all unique emails inside a column filled with data -


i have column's field filled kinds of data user request (one request per row).

i need email addresses these users' requests, , placed in column according following format:

[...data...] email: mysql@se.com phone: [...remaining data...] 

i have found question:

select part of table column data in mysql

which provides solution part of problem:

select substr(message,instr(message,'email: ')+7) user_req_log 

however, return unwanted remaining data.

what's efficient way confine results strings need (email addresses) and, @ same time, ignore duplicates?

based on question's solution, may do:

select distinct substr(message,                        @ini_pos:=instr(message,'email: ')+7,                        instr(message,' phone:')-@ini_pos) `user_req_log` 

it may not efficient way, it's similar:


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -