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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -