window rain

Iain's nonsensical words

I recently had a need to select the 1st letter of the last word in a stored field.
This is my 10min stumbling result:

select SUBSTRING(REVERSE('Iain Cuthbertson'), LOCATE(' ', REVERSE('Iain Cuthbertson')) - 1, 1) as result;


MySQL only code I'm afraid folks.


Diary feed
 + RSS 2.0 XML feed


Everything on this site is (c) Iain Cuthbertson unless otherwise noted.