Thursday, February 25, 2010

SQL Talking

Best Wishes from SQL

scott@10G> select decode
  2        (sign (floor (maxwidth/2) - rownum)
  3        ,1, lpad (' ', floor (maxwidth/2) - (rownum -1))
  4           ||rpad ('*', 2 * (rownum -1), ' *')
  5        ,lpad ('* * *', floor (maxwidth/2) + 3)) "Merry Christmas"
  6  from dual
  7  ,    (select 40 as maxwidth from dual)
  8  connect by level < floor (maxwidth/2) + 5
  9  /

Merry Christmas
-----------------------------------------------------------------------

                   *
                  * *
                 * * *
                * * * *
               * * * * *
              * * * * * *
             * * * * * * *
            * * * * * * * *
           * * * * * * * * *
          * * * * * * * * * *
         * * * * * * * * * * *
        * * * * * * * * * * * *
       * * * * * * * * * * * * *
      * * * * * * * * * * * * * *
     * * * * * * * * * * * * * * *
    * * * * * * * * * * * * * * * *
   * * * * * * * * * * * * * * * * *
  * * * * * * * * * * * * * * * * * *
                  * * *
                  * * *
                  * * *
                  * * *
                  * * *

24 rows selected.

No comments:

Post a Comment