My Step-Father’s Cremation

Antonio Enrico Martini was cremated on 19th April 2013. He had been a chef for many years and one of his friends, whose name I shall add here when I remember it – read this Address to a chef when Enrico retired in 1987. The version below, was amended from the 1987 version. Both are based on Address to a Pudding by Rabbie Burns. Read more »

Swap 2 Values, in SQL, Without Using a Temporary Variable

Recently, I saw a mention of an interview question for SQL developers. It was something along the lines of:

There is a table with a sex column. It has been discovered that the values are swapped around and need to be corrected. How would you swap all ‘M’ values to ‘F’ and all ‘F’ values to ‘M’, while leaving the other values untouched, in one single SQL statement and without requiring the use of any temporary variables.

So, how would you do it? Here’s my example. Read more »