Quantcast
Channel: Software Applications Programming Errors and solutions.
Viewing all articles
Browse latest Browse all 277

How to separate string from email id in SQL

$
0
0
To separate string from email id in SQL you can try below query. seperate 'test' '@' 'xyz' ' com'  from test@xyz.com

SELECT
SUBSTR(mailID, 1, INSTR(mailID, '@', 1, 1)-1) String1,
SUBSTR(mailID, INSTR(mailID, '@', 1, 1), 1) String2,
SUBSTR(mailID, INSTR(mailID, '@', 1, 1)+1, INSTR(mailID, '.', 1, 1)-INSTR(mailID, '@', 1, 1)-1) String3,
SUBSTR(mailID, INSTR(mailID, '.', 1, 1)+1) String4
FROM (SELECT '&MailID' mailID FROM Dual );

Viewing all articles
Browse latest Browse all 277

Trending Articles