'Alteryx Designer - How to retrieve only first and last name from field excluding middle initials?

I need help in writing SQL code in Alteryx Designer.

My table employees contains a column Name with values shown below. However, I need the expected output as shown below.

Please help.

Name:

  1. Smith, Mary K
  2. Koch, J B
  3. Batoon Rene, Anne S
  4. Vaughan-tre Doctor, Maria S

Excepted output:

  1. Smith, Mary
  2. Koch, J
  3. Batoon Rene, Anne
  4. Vaughan-tre, Maria

The middle initials and “Doctor” word is removed.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source