Home » RDBMS Server » Server Administration » In continuation with Date/Time subtraction
In continuation with Date/Time subtraction [message #372595] Mon, 26 February 2001 19:58 Go to next message
Surendra K
Messages: 8
Registered: September 2000
Junior Member
How do i see the result with date and time format in SQL Plus.
Re: In continuation with Date/Time subtraction [message #372596 is a reply to message #372595] Mon, 26 February 2001 22:24 Go to previous messageGo to next message
vinay
Messages: 27
Registered: December 1999
Junior Member
Syntax to see date and time

select to_char(<column name>,'dd-mon-yyyy hh:mm:ss') from
;

Eg.
select to_char(sysdate,'dd-mon-yyyy hh:mm:ss') from dual;
Re: (SORRY discard prev) In continuation with Date/Time subtraction [message #372597 is a reply to message #372595] Mon, 26 February 2001 23:42 Go to previous messageGo to next message
vinay
Messages: 27
Registered: December 1999
Junior Member
Syntax to see date and time
select to_char(,'dd-mon-yyyy hh:mi:ss') from ;
Eg.
select to_char(sysdate,'dd-mon-yyyy hh:mi:ss') from dual;
Re: In continuation with Date/Time subtraction [message #372599 is a reply to message #372595] Tue, 27 February 2001 00:46 Go to previous message
Joachim Lindner
Messages: 30
Registered: February 2001
Member
You could also do the following, so you wouldn't have to wrap your date selects everytime.

SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'dd-mon-yyyy hh:mi:ss';

Session altered.

SQL> select sysdate from dual;

SYSDATE
--------------------
27-feb-2001 07:33:32

SQL>
Previous Topic: Re: search for '%' or '_' patterns
Next Topic: Embed c-functions into PL/SQL
Goto Forum:
  


Current Time: Fri May 31 19:07:16 CDT 2024