Re: EXPLANATION FOR THE QUERY

Re: EXPLANATION FOR THE QUERY

 

  

The below query will give the first day of the month on the selected
records.
Ex: if the selected row has the date of 18-Mar-2007, then the below query
will give 01-Mar-2007.

Try with this query:
SELECT TO_DATE((RTRIM(TO_CHAR(SYSDATE
,'YYYY'))|| '-' ||RTRIM(TO_CHAR(SYSDATE
,'MM'))||'-01')
,'YYYY-MM-DD')
FROM dual ;

TO_DATE((RT
-----------
01-MAR-2007


----- Original Message -----
From: "KRISHNAMOORTHY Prabhu Ramachandran "
<oracledba-ezmlmshield-x54917323.[Email address protected]
To: "LazyDBA Discussion" <[Email address protected]
Sent: Friday, March 30, 2007 11:23 AM
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
>
>
>



Disclaimer: This communication is for the exclusive use of the intended recipient(s) and shall not attach any liability on the originator or ITC Infotech India Ltd./its Holding company/ its Subsidiaries/ its Group Companies. If you are the addressee, the contents of this e-mail are intended for your use only and it shall not be forwarded to any third party, without first obtaining written authorization from the originator or ITC Infotech India Ltd./ its Holding company/its Subsidiaries/ its Group Companies. It may contain information which is confidential and legally privileged and the same shall not be used or dealt with by any third party in any manner whatsoever without the specific consent of ITC Infotech India Ltd./ its Holding company/ its Subsidiaries/ its Group Companies.


Oracle LazyDBA home page