Alex Papadimoulis

Founder, The Daily WTF

Aug 2012

SQL Splits

by in CodeSOD on

"I should probably start by saying that I am not a SQL expert," Paul wrote. "Sure, I've written my share of SELECT statements, plenty of UPDATE statements, and even a few ALTER statements, but beyond that... nada."

"Fortunately, we do have a SQL guru at work that I can learn from, and thankfully, his code is right there, in the database. Imagine my delight when I uncovered this 2,045-line snippet of SQL Magic that, so far as my non-expert mind can tell, attempts to split a name like 'HARTLEY JR' into two parts."