I am using a select query to get the email Ids. However in email ID column except email there is a text in between ; and : which I want to trim so that I can only get the email Ids nothing else.
;
:
For example:-
;some text here: [email protected] ---- this is the data, and I want to select only email ID not the text before that.
;some text here: [email protected]
How can I achieve it?
Thanks.
Assuming the unwanted text would always appear before the email address, then you need only use substring:
SELECT col, TRIM(SUBSTR(col, INSTR(col, ':') + 1)) AS email FROM yourTable;
Demo
1.4m articles
1.4m replys
5 comments
56.9k users