/* Made for Oracle 9i and upwards. Uses the "Hierarchical Query" feature to generate bottles onna wall. The pseudo-column "level" denotes the current recursion depth. The maximum bottle count (a.k.a. recursion depth) is 255 (oracle 9i, iirc), so you better serve some ale :) */ select decode(wall.bottles, 0, 'No more bottles of beer on the wall, '|| 'no more bottles of beer.'||chr(10)|| 'Go to the store and buy some more, '|| '99 bottles of beer on the wall.',