fix HH24 date format, and use Oracle ROWNUM not LIMIT in SQL