Skip to main content

Posts

Showing posts with the label split string in sql

How to separate string from email id in SQL

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 );