
244 PUZZLE 62 REPORT FORMATTING
PUZZLE
62 REPORT FORMATTING
SQL is a data retrieval language and not a report writer. Unfortunately,
people do not seem to know this and are always trying to do things for
which SQL was not intended. One of the most common ones is to
arrange a list of values into a particular number of columns for display.
The original version of this puzzle came from Richard S. Romley at
Smith Barney, who many of you know as the man who routinely cooks my
SQL puzzle solutions. He won a bet from a coworker who said it could not
be done. The problem is to first create a simple one-column table “Names”
with a single unique “name” ...