Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to remove the seconds component from the output ?

York35Jul 10 2014 — edited Jul 10 2014

DB version:11.2

I don't want the seconds component not to be printed in the output. ie. 53 shown in red below.

Of course, I can remove SS from NLS_DATE_FORMAT setting to achieve this. But, I need a way to suppress the seconds component at the SELECT level. Like ROUND or TRUNC... etc

SQL> alter session set nls_date_format='dd-mm-yyyy hh24:mi:ss';

SQL>

SQL> select (sysdate-240/1440) from dual;

(SYSDATE-240/1440)

-------------------

10-07-2014 13:12:53

SQL>

Expected output

-------------------

10-07-2014 13:12

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2014
Added on Jul 10 2014
5 comments
1,505 views