Language Oracle 9i SQL
Date: | 04/20/05 |
Author: | Albert Indeev |
URL: | n/a |
Comments: | 2 |
Info: | n/a |
Score: | ![]() |
-- SQL (Oracle9i) -- history from Albert Indeev -- assa@ykt.ru -- 29.01.2004 6:00+GMT9 -- tested on Oracle 9.2.0.4 -- used only one table - "dual" :) select case when 1 < 100-rownum then to_char(100-rownum) || ' bottles of beer on the wall,' || chr(10) || to_char(100-rownum) || ' bottles of beer.' || chr(10) || 'Take one down, pass it around,' || chr(10) || to_char( 99-rownum) || ' bottles of beer on the wall.' when 1 = 100-rownum then to_char(100-rownum) || ' bottle of beer on the wall,' || chr(10) || to_char(100-rownum) || ' bottle of beer.' || chr(10) || 'Take one down, pass it around,' || chr(10) || 'No more beers.' end history from (select 1 from dual group by cube (1,1,1,1,1,1,1)) where rownum+28 < 128;
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
Note : All the languages(!) below are needed to be stated as "Alternate versions of PL/SQL" :
"Oracle SQL"
"PL/SQL"
"Oracle 9i SQL"
"SQL (Self contained Oracle 9i+ Version)"
"SQL (Produces the exact lyrics, ORACLE)"
There is no PL/SQL here, its pure SQL - for Oracle of course, not sure if any other SQL based DB's use a dummy table called 'Dual'.
Its also compact and extremely clever. Love the group by cube action!
Agree with your other comment about the versions, agreed. Perhaps should just be under heading 'SQL' as there are MySQL and Sybase versions here among others.