I have data where persons full name is one string.  

There are 2 variations, one with comma (last name, first) and one with single space (First name, last)

* Smith, John
* John Smith

John Smith

I was able to extract the last name using this:

```
,CASE WHEN POSITION(',',B.NAME,1) > 0 THEN SUBSTRING(B.NAME,0,POSITION(',',B.NAME,1)-1) 
        ELSE SUBSTRING(B.NAME,0,POSITION(' ',B.NAME,1)-1)
END AS LAST_NAME

```

Having trouble getting the first name though. Any suggestions?