RE: EXPLANATION FOR THE QUERY

RE: EXPLANATION FOR THE QUERY

 

  


Simplifying the query may help:

select to_date('01-'||to_char(sysdate,'mm-yyyy'),'dd-mm-yyyy') start_month
from dual
/
START_MONTH
-----------
01-MAR-2007

All the query is doing is taking the current month and year and adding "01"
as the day.

John.


-----Original Message-----
From: RAVI VALLEMONI
[mailto:oracledba-ezmlmshield-x5813587.[Email address protected]
Sent: 30 March 2007 08:28
To: LazyDBA Discussion
Subject: RE: EXPLANATION FOR THE QUERY


Hi all,

Ok it is displaying first day of the current month but how.

Can anyone look into this?


Thanks & Regards

Ravi Kumar Vallemoni
| Tech - Mahindra | Pune |India |Tel: +91 20 66221000 + 1695 | Email:
[Email address protected] |

-----Original Message-----
From: lokesha
[mailto:oracledba-ezmlmshield-x37144894.[Email address protected]
Sent: Friday, March 30, 2007 11:47 AM
To: LazyDBA Discussion
Subject: 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.



---------------------------------------------------------------------
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 message and the information contained herein is proprietary and
confidential and subject to the Tech Mahindra policy statement, you may
review at <a
href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.c
om/Disclaimer.html</a> externally and <a
href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.c
om/Disclaimer.html</a> internally within Tech Mahindra.

============================================================================
================================================


---------------------------------------------------------------------
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


-----------------------------------------
Information in this email including any attachments may be
privileged, confidential and is intended exclusively for the
addressee. The views expressed may not be official policy, but the
personal views of the originator. If you have received it in error,
please notify the sender by return e-mail and delete it from your
system. You should not reproduce, distribute, store, retransmit,
use or disclose its contents to anyone.

Please note we reserve the right to monitor all e-mail
communication through our internal and external networks.

SKY and the SKY marks are trade marks of British Sky Broadcasting
Group plc and are used under licence. British Sky Broadcasting
Limited (Registration No. 2906991), Sky Interactive Limited
(Registration No. 3554332), Sky-In-Home Service Limited
(Registration No. 2067075) and Sky Subscribers Services Limited
(Registration No. 2340150) are direct or indirect subsidiaries of
British Sky Broadcasting Group plc (Registration No. 2247735). All
of the companies mentioned in this paragraph are incorporated in
England and Wales and share the same registered office at Grant
Way, Isleworth, Middlesex TW7 5QD.


Oracle LazyDBA home page