Hi all, while we're waiting for the next great Phil Factor Speed Phreak competition I would like to pose my own problem, no business value here, it's just for fun. Ten years ago when SQL Server 2000 was just coming out I wrote a query that I have not revisited since. If I recall, I wrote it to beat the Wordster game on the Megatouch consoles that were permeating the local bars. I am confident some of you can create a more eloquent solution (I don't want to influence your creativity so I will not reveal my old quirky solution until after some responses are given).
The Problem: given 8 or fewer letters, return all unique words of 3 or more letters that can be formed from the letters given, ordered by longest words first. You are free to create a word list table any way you want. The combinations of letters returned should be matched against this word list table so that only actual words are returned.