question

Nini1 avatar image
Nini1 asked

Dealing with duplicates in field values

I have such field that has values like:

  1. George,George,George
  2. Ann,Ann
  3. John,Ann,John
  4. Liza,Jack
  5. Nina
  6. Leticia
  7. Leny,Ann,Mary,Mary,Ann

I'm trying to create the field according to the filed above that will have values like:

  1. George
  2. Ann
  3. John,Ann
  4. Liza,Jack
  5. Nina
  6. Leticia
  7. Leny,Ann,Mary

I used the following SQL code:

Case when Charindex ( ' , ' , [data I have] ) > 0 then substring ( [data I have] , 0 , charindex ( ' , ' , [data I have] , 0 ) else [data I have] end)

This code deals with 1,2,5,6 cells but fails in case of 3,4,7 because it leaves John in 3., Jack in 4. and Ann in 7.

Could you please help to find the way how to fix it?

Thank you

delete-duplicates
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.