window rain

Iain's nonsensical words

Following on from last month's Select the 1st letter of the last word in MySQL, I then needed a way to select the last word from string (or column).

SELECT REVERSE(LEFT(REVERSE('Iain Cuthbertson'), LOCATE(' ', REVERSE('Iain Cuthbertson')) -1));


Now I can sort rows by surname when the full name is in just one cell!


Diary feed
 + RSS 2.0 XML feed


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