I have a column like this:
log
---
smart.pc
mobile.my.phone
laptop.student.school
dog.house
pc.game.headset
And I want to take only the last values after '.':
log
---
pc
phone
school
house
headset
I tried with case when log like '%.%'
to take the values but in the replace after I do not know what to put in the old value's place to take all the values from the column. REPLACE(log, '', '')
Seems it has also answered here : Is there a LastIndexOf in SQL Server?