1

Table name: Table1

The table has 2 columns

Id   Name

1     1|admin|abs@yahoo.com
2     22|user|aaaaa@yahoo.com

From the Name column I want to fetch the email adress

Result:

Name
abs@yahoo.com    
aaaaa@yahoo.com
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
kanth
  • 341
  • 3
  • 9
  • 18
  • possible duplicate of [T-SQL: Opposite to string concatenation - how to split string into multiple records](http://stackoverflow.com/questions/314824/t-sql-opposite-to-string-concatenation-how-to-split-string-into-multiple-recor) – Lieven Keersmaekers May 09 '11 at 11:20

1 Answers1

1

try this one

select SUBSTRING(name,CHARINDEX('|',name, CHARINDEX('|', name)+1)+1,100) from  Table1
Adnan M. TURKEN
  • 1,554
  • 4
  • 21
  • 36