DB2 vs. Oracle – handling dates

You may also like...

2 Responses

  1. Tanakorn T. says:

    For the first example I would do:

    select cust_first_name, cust_last_name
    from oe.customers
    where date_of_birth – sysdate between -2 and 7
    and extract (month from date_of_birth) = extract (month from sysdate)
    order by date_of_birth –<< It is already order by date, Jan always comes before Feb, except you want it the other way round, you put 'desc'

  1. May 16, 2011

    […] Handling of dates (see post on this) […]

Leave a Reply

Your email address will not be published. Required fields are marked *