A similar question has already been asked, however Amazon Redshift does not support some of the commands of MySQL, so there is a need to adapt the code.

I am trying to extract the last word out of a string in a given column.

```
col1 |
+-----+
|a    |
|b c  |
|d e f|

```

This would be an output:

```
|result|
+------+
|a     |
|c     |
|f     |

```

I have tried working with `SUBSTRING_INDEX`,

```
SELECT SUBSTRING_INDEX("a b c", " ", -1);

```

however it does not work with Redshift.

Thus, I thought about using `SUBSTRING` with `POSITION`, but `POSITION` finds only the first space and does not seem to work:

```
SELECT SUBSTRING(column, POSITION (' ' in REVERSE(column)), 10)

```

Any idea how to do this?