RE: EXPLANATION FOR THE QUERY

RE: EXPLANATION FOR THE QUERY

 

  

Hi,

This is a quicker way of doing the same thing:

SELECT trunc (sysdate,'MON') from dual;

the trunc function returns a date truncated to a specific unit of measure.

The syntax is:

trunc ( date, [ format ] )

where date is the date to truncate.

Rgds

Philippe

-----Original Message-----
From: KRISHNAMOORTHY Prabhu Ramachandran
[mailto:oracledba-ezmlmshield-x54917323.[Email address protected]
Sent: 30 March 2007 06:54
To: LazyDBA Discussion
Subject: EXPLANATION FOR THE QUERY

HI ALL,


CaN ANY ONE GIVE ME A CLEAR EXPL FOR THE BELOW QUERY




SELECT TO_DATE((RTRIM(TO_CHAR(SYSDATE
,'YYYY'))|| '-' ||RTRIM(TO_CHAR(SYSDATE
,'MM'))||'-01')
,'YYYY-MM-DD')
FROM ps_installation


Thanks
Prabhu Ramachandran Krishnamoorthy

Confidentiality Statement:

This message is intended only for the individual or entity to which it is
addressed. It may contain privileged, confidential information which is
exempt from disclosure under applicable laws. If you are not the intended
recipient, please note that you are strictly prohibited from disseminating
or distributing this information (other than to the intended recipient) or
copying this information. If you have received this communication in error,
please notify us immediately by return email.
-----------------------------


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
*********************************************************************
This electronic transmission is strictly confidential and intended solely
for the addressee. It may contain information which is covered by legal,
professional or other privilege. If you are not the intended addressee,
you must not disclose, copy or take any action in reliance of this
transmission. If you have received this transmission in error,
please notify the sender as soon as possible.

This footnote also confirms that this message has been swept
for computer viruses.
**********************************************************************


Oracle LazyDBA home page