Pages

Friday, May 28, 2010

A quick quiz for a Friday.

What is the largest number you can get from a three character string ?

999 ?
Not even close.

How about 9 billion ?

select to_number('9e9') from dual;

TO_NUMBER('9E9')
--------------------
9,000,000,000

Any advance on that ?

4 comments:

  1. infinite?


    select power(
    to_number('999'),
    to_number('999'))
    from dual;
    SQL> /
    *
    ERROR at line 1:
    ORA-01426: numeric overflow


    ;)

    ReplyDelete
  2. Another quick one:
    1* select exp('999') from dual
    SQL> /
    select exp('999') from dual
    *
    ERROR at line 1:
    ORA-01426: numeric overflow

    ;)

    ReplyDelete
  3. Anonymous4:38 am

    In MySQL too ;)

    mysql> select 9e9;
    +------------+
    | 9e9 |
    +------------+
    | 9000000000 |
    +------------+
    1 row in set (0.01 sec)

    mysql>

    Rachid

    ReplyDelete
  4. Breaks some dates, too

    select to_date(TO_NUMBER('9E9'),'j') from dual;

    ORA-01854: julian date must be between 1 and 5373484

    ReplyDelete

Note: only a member of this blog may post a comment.