Ayesha Fathima

Ayesha Fathima

  • NA
  • 184
  • 30.1k

Retrieve email id from full email

Apr 22 2020 3:37 AM
Hi there,
 
I need to take email id from full email address.
 
Example 
Input 
 
Needed output
 
i have tried the below query but it is giving only one email id not all.Some help will be greatly appreciated.
  1. SELECT  CASE WHEN to_address LIKE '%<%' THEN SUBSTRING(to_address,CHARINDEX('<',to_address)+1,CHARINDEX('>',to_address)-CHARINDEX('<',to_address)-1) ELSE to_address END AS ToAddress from test     

Answers (1)