snp.it
snp.it

Reputation: 522

Pipe Delimited info Column

I have this column which is Pipe delimited.

ID         Col1
1000        Class1|Sec2|Tom|Brady
1001        Class1|Sec2|Row4|Tim|Tebow
1002        Class2|Sec2|Row3|Huck|Fin
1003        Class2|Sec2|Tom|Sawyer
1004        Class10|Sec1|Rowq|sa|

Now how can I just get the names after the last pipe.

O/P

 ID         Col1
1000        Brady
1001        Tebow
1002        Fin
1003        Sawyer
1004        

Can anyone please help me out on this.

Thanks

Upvotes: 0

Views: 116

Answers (1)

juergen d
juergen d

Reputation: 204766

Never, never, never store multiple values in one column!

Like you see now this will only give you headaches. Normalize your table. It should look like this

ID     Class   Section   Firstname   Lastname
1000   Class1  Sec2      Tom         Brady

Upvotes: 3

Related Questions