Mailing List
Home
Forum Home
Oracle List - by freelists.org
Oracle on SUSE Linux - Runing Oracle on SUSE Linux
Oracle database error code ...
www.freelists.org
Subjects
ORA 12540: TNS:internal limit restriction exceeded
ORA 12838 please : Is possible to append two times to the same table befo
ORA 12838 please : Is possible to append two times to the same table before
ora 04031
ora 12500 on windows
ORA 32004: obsolete and/or deprecated parameter(s) specified
ORA 01925: maximum of 30 enabled roles exceeded
ORA 01925: maximum of 30 enabled roles exceeded
ora 12500 on windows
ORA 01650, one idea
ORA 01650
ORA 4030
ORA 12838 please : Is possible to append two times to thesametable before do
ORA 12838 please : Is possible to append two times to thesame table before d
ORA 01536
ORA 03113 end of file on communication channel
ORA 32004: obsolete and/or deprecated parameter(s) specified
ORA 00600:
ORA 00020: maximum number of processes (%s) exceeded
ORA 01925: maximum of 30 enabled roles exceeded
ORA 3113 while creating a cluster database 9201 RAC on Linux with OCFS
ora 12500 on windows
ora 12500 on windows
ora 12500 on windows
ORA 01650, one idea
ora 12500 on windows
ora 12500 on windows
ora 12500 on windows
ORA 2000 Error Using DBMS STATS GATHER SCHEMA STATS
ORA 01650, one idea
ORA 01650, one idea
ORA 01650, one idea
ORA 01650
ORA 01650
Subject: ora 01031
ORA 4030
ORA 4030
ORA 06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind
Subject: Re: ORA 01722 invalid number
 
Subject: Re: Query Tuning Help

Subject: Re: Query Tuning Help

2007-11-01       - By Vlad Sadilovskiy

 Back
Too many unknowns. And hence too many suggestions can be made. It is hard to
estimate what's the best path without looking at statistics, i.e.
CARDINALITY figures. According to the plan shown, the sub query is executed
for every row that is gotten from "CALL_DETAIL" after applying filters

                        orig_dt >= TO_DATE ('20071016000000',
'yyyymmddhh24miss')
              AND orig_dt < TO_DATE ('20071016010000', 'yyyymmddhh24miss')
              AND (record_typ='STOP' OR call_duration_value>0)

Suppose, fetching from "CALL_DETAIL" by GUID is more preferable. You should
see why the sub query is not made the outer (first) row source. Several
things might go wrong, i.e. cost of the sub query could be too low or the
filtered CARDINALITY of the "CALL_DETAIL" by the rest of the predicates
could be too low, or these two factors combined.

On the other hand, it's not possible to say exactly how query could be
better rewritten when the structure of the tables and the statistics aren't
known. If my eyes aren't fooling me, then the query can be also rewritten
into NOT IN form:

SELECT
        billing_act_nbr, final_tg_nbr, COUNT(*), SUM (call_duration_value),
        SUM (rated_cost_amt)
    FROM cdrw.call_detail
  WHERE orig_dt >= TO_DATE ('20071016000000', 'yyyymmddhh24miss')
              AND orig_dt < TO_DATE ('20071016010000', 'yyyymmddhh24miss')
              AND (record_typ='STOP' OR call_duration_value>0)
              AND guid IS NOT NULL
              AND guid NOT IN
         (SELECT
                  guid
             FROM cdrw.call_detail_cost_vero d
            WHERE orig_dt >= TO_DATE ('20071016000000', 'yyyymmddhh24miss')

              AND orig_dt < TO_DATE ('20071016010000', 'yyyymmddhh24miss')
              AND GUID IS NOT NULL)
    group by billing_act_nbr, final_tg_nbr;

NOT EXISTS transformation has been already proposed by Hrishy. But these two
forms can also go the "FILTER" path. So, you need to see why that
is. However, it is more likely to be an ANTI JOIN in case sub query is of
high CARDINALITY. The outer join trick by SF also is good depending on the
situation with the statistics. Null values would need to be filtered if GUID
can be null.

Regarding the temp table. You could also consider using "WITH" clause in
some cases instead.

Vlad Sadilovskiy
Oracle Database Tools
Web site: http://www.fourthelephant.com
Oracle blog: http://vsadilovskiy.wordpress.com

On 10/31/07, Stephane Faroult <sfaroult@(protected)> wrote:
>
> Let me have a try at it ...
>
> SELECT  a.billing_act_nbr, a.final_tg_nbr, COUNT(*), SUM
> (a.call_duration_value),
>         SUM (a.rated_cost_amt)
>    FROM cdrw.call_detail a
>          left outer join (select guid
>                                   from drw.call_detail_cost_vero
>                                    where orig_dt >= TO_DATE
> ('20071016000000', 'yyyymmddhh24miss')
>                                         and orig_dt < TO_DATE
> ('20071016010000', 'yyyymmddhh24miss')) b
>                      on a.guid = b.guid
>             WHERE a.orig_dt >= TO_DATE ('20071016000000',
> 'yyyymmddhh24miss')
>               AND a.orig_dt < TO_DATE ('20071016010000',
> 'yyyymmddhh24miss')
>                        AND (a.record_typ='STOP' OR a.call_duration_value
> >0)
>    and b.guid is null
> GROUP BY a.billing_act_nbr, a.final_tg_nbr;
>
> I always suppress hints until proved necessary ...
>
> Hope it works better ...
>
> SF
>
>
> A Ebadi wrote:
> > We've been trying to tune this query below, but to no avail.  The
> > table call_detail below is a very large hourly partitioned table with
> > each partition being about 2-4GB!  The other table
> > (call_detail_cost_vero) is relatively small.
> >
> > The two inner selects with minus runs fine alone in about 6-8 minutes,
> > but the entire query doesn't finish even after running it for many
> > hours!  We've tried running it in parallel/no parallel and hasn't
> > helped.  Any recommendations would be appreciated.  The explain plan
> > is at the bottom of this e-mail also.
> >
> > Thanks,
> > Abdul
> >
> > Environment: Sun Solaris, Oracle 10.2.0.3.0 on RAC (4 node)
> >
> > SELECT /*+ parallel(a,10) */
> >          billing_act_nbr, final_tg_nbr, COUNT(*), SUM
> > (call_duration_value),
> >          SUM (rated_cost_amt)
> >     FROM cdrw.call_detail a
> >              WHERE orig_dt >= TO_DATE ('20071016000000',
> > 'yyyymmddhh24miss')
> >                AND orig_dt < TO_DATE ('20071016010000',
> > 'yyyymmddhh24miss')
> >                         AND (record_typ='STOP' OR call_duration_value>0)
> >      AND guid IN (
> >             SELECT
> >                    guid
> >               FROM cdrw.call_detail c
> >              WHERE orig_dt >= TO_DATE ('20071016000000',
> > 'yyyymmddhh24miss')
> >                AND orig_dt < TO_DATE ('20071016010000',
> > 'yyyymmddhh24miss')
> >                         AND (record_typ='STOP' OR call_duration_value>0)
> >             MINUS
> >             SELECT
> >                    guid
> >               FROM cdrw.call_detail_cost_vero d
> >              WHERE orig_dt >= TO_DATE ('20071016000000',
> > 'yyyymmddhh24miss')
> >                AND orig_dt < TO_DATE ('20071016010000',
> > 'yyyymmddhh24miss'))
> > GROUP BY billing_act_nbr, final_tg_nbr;
> >
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

<div>Too many unknowns. And hence too many suggestions can be made. It is hard
to estimate what&#39;s the best path without looking at statistics, i.e.
CARDINALITY&nbsp;figures. According to the plan shown, the sub query is
executed for every row that is gotten from &quot;CALL_DETAIL&quot; after
applying filters
</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; orig_dt
&gt;= TO_DATE (&#39;20071016000000&#39;, &#39;yyyymmddhh24miss&#39;)<br>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AND orig_dt &lt; TO_DATE (&#39;20071016010000&#39;, &#39;yyyymmddhh24miss&#39;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;AND (record_typ=&#39;STOP&#39; OR call_duration_value&gt;0)
<br>&nbsp;</div>
<div>
<div>Suppose, fetching from &quot;CALL_DETAIL&quot; by GUID is more preferable.
You should see why the sub query is not&nbsp;made the outer (first) row source.
Several things might go wrong, i.e. cost of the sub query could be too low or
the filtered CARDINALITY of the &quot;CALL_DETAIL&quot; by the rest of the
predicates could be too low, or these two factors combined.
</div>
<div>&nbsp;</div>
<div>On the other hand, it&#39;s not&nbsp;possible to say&nbsp;exactly how
query could be better rewritten when the structure of the tables and the
statistics aren&#39;t known. If my&nbsp;eyes aren&#39;t fooling me, then the
query can be also rewritten into NOT IN form:&nbsp;
</div></div>
<div>&nbsp;</div>
<div>SELECT<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; billing_act_nbr
, final_tg_nbr, COUNT(*), SUM (call_duration_value),<br>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; SUM (rated_cost_amt)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; FROM <font color="#550055">cdrw.call_detail</font
></div>
<div><font color="#550055">&nbsp;&nbsp; WHERE orig_dt &gt;= TO_DATE (&#39
;20071016000000&#39;, &#39;yyyymmddhh24miss&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND orig_dt &lt; TO
_DATE (&#39;20071016010000&#39;, &#39;yyyymmddhh24miss&#39;)<br>&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;AND (record_typ=&#39;STOP&#39; OR call_duration_value&gt;0)
<br><font color="#550055">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND guid IS NOT NULL</font></font></div>
<div><font color="#550055"><font color="#550055">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND guid NOT IN<
/font></font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (<span
class="q">SELECT<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; guid<br>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM cdrw.call
_detail_cost_vero d<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; WHERE orig_dt &gt;= TO_DATE (&#39;20071016000000&#39;, &#39
;yyyymmddhh24miss&#39;)
<br></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; AND orig_dt &lt; TO_DATE (&#39;20071016010000&#39;, &#39
;yyyymmddhh24miss&#39;)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; AND GUID&nbsp;IS NOT&nbsp;NULL)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; group by billing_act_nbr, final_tg_nbr;</div>
<div>&nbsp;</div>
<div>NOT EXISTS transformation has been already proposed by Hrishy. But these
two forms can also go the &quot;FILTER&quot; path. So, you need to see why that
is.&nbsp;However, it is more likely to&nbsp;be an ANTI JOIN in case sub query
is of high CARDINALITY. The outer join trick by SF also is good depending on
the situation with the statistics. Null values would need to be filtered if
GUID can be null.
<br>&nbsp;</div>
<div>Regarding the temp table. You could also consider using &quot;WITH&quot;
clause in some cases instead.</div>
<div>&nbsp;</div>
<div>Vlad Sadilovskiy<br>Oracle Database Tools<br>Web site: <a href="http://www
.fourthelephant.com/">http://www.fourthelephant.com</a><br>Oracle blog: <a href=
"http://vsadilovskiy.wordpress.com/">http://vsadilovskiy.wordpress.com
</a><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/31/07, <b class="gmail_sendername"
>Stephane Faroult</b> &lt;<a href="mailto:sfaroult@(protected)">sfaroult
@(protected)</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0
.8ex; BORDER-LEFT: #ccc 1px solid">Let me have a try at it ...<br><br>SELECT
&nbsp;&nbsp;a.billing_act_nbr, a.final_tg_nbr, COUNT(*), SUM<br>(a.call_duration
_value
),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SUM (a.rated_cost_amt)<br
>&nbsp;&nbsp; FROM cdrw.call_detail a<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; left outer join (select guid<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;from drw.call_detail_cost_vero<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; where orig_dt &gt;= TO_DATE
<br>(&#39;20071016000000&#39;, &#39;yyyymmddhh24miss&#39;)<br>&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and orig_dt
&lt; TO_DATE<br>(&#39;20071016010000&#39;, &#39;yyyymmddhh24miss&#39;)) b<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on a.guid
= b.guid<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;WHERE a.orig_dt &gt;= TO_DATE (&#39;20071016000000&#39;,<br>&#39
;yyyymmddhh24miss&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND a.orig_dt &lt; TO_DATE (&#39;20071016010000&
#39;,<br>&#39;yyyymmddhh24miss&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; AND (
a.record_typ=&#39;STOP&#39; OR a.call_duration_value&gt;0)<br>&nbsp;&nbsp; and
b.guid is null<br>GROUP BY a.billing_act_nbr, a.final_tg_nbr;<br><br>I always
suppress hints until proved necessary ...<br><br>Hope it works better ...<br>
<br>SF<br><br><br>A Ebadi wrote:<br>&gt; We&#39;ve been trying to tune this
query below, but to no avail.&nbsp;&nbsp;The<br>&gt; table call_detail below is
a very large hourly partitioned table with<br>&gt; each partition being about 2
-4GB!&nbsp;&nbsp;The other table
<br>&gt; (call_detail_cost_vero) is relatively small.<br>&gt;<br>&gt; The two
inner selects with minus runs fine alone in about 6-8 minutes,<br>&gt; but the
entire query doesn&#39;t finish even after running it for many<br>
&gt; hours!&nbsp;&nbsp;We&#39;ve tried running it in parallel/no parallel and
hasn&#39;t<br>&gt; helped.&nbsp;&nbsp;Any recommendations would be appreciated.
&nbsp;&nbsp;The explain plan<br>&gt; is at the bottom of this e-mail also.<br>
&gt;<br>&gt; Thanks,
<br>&gt; Abdul<br>&gt;<br>&gt; Environment: Sun Solaris, Oracle 10.2.0.3.0 on
RAC (4 node)<br>&gt;<br>&gt; SELECT /*+ parallel(a,10) */<br>&gt;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;billing_act_nbr, final_tg_nbr,
COUNT(*), SUM<br>&gt; (call_duration_value),
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SUM (rated
_cost_amt)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; FROM cdrw.call_detail a<br>&gt;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;WHERE orig_dt &gt;= TO_DATE (&#39;20071016000000&#39;,<br>&gt; &#39
;yyyymmddhh24miss&#39;)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND orig_dt &lt; TO_DATE (&#39
;20071016010000&#39;,
<br>&gt; &#39;yyyymmddhh24miss&#39;)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND (record_typ=&#39;STOP&#39; OR call_duration
_value&gt;0)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND guid IN (<br>&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guid<br>&gt;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM
cdrw.call_detail c<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE orig_dt &gt;= TO_DATE (&#39;20071016000000&
#39;,<br>&gt; &#39;yyyymmddhh24miss&#39;)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND orig_dt
&lt; TO_DATE (&#39;20071016010000&#39;,<br>&gt; &#39;yyyymmddhh24miss&#39;)
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND
(record_typ=&#39;STOP&#39; OR call_duration_value&gt;0)<br>&gt;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINUS<br>&gt;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT<br>&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guid<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM cdrw.call
_detail_cost_vero
d<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;WHERE orig_dt &gt;= TO_DATE (&#39;20071016000000&#39;,<br>&gt;
&#39;yyyymmddhh24miss&#39;)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND orig_dt &lt; TO_DATE (
&#39;20071016010000&#39;,<br>&gt; &#39;yyyymmddhh24miss&#39;))
<br>&gt; GROUP BY billing_act_nbr, final_tg_nbr;<br>&gt;<br><br><br>--<br><a
href="http://www.freelists.org/webpage/oracle-l">http://www.freelists.org
/webpage/oracle-l</a><br><br><br></blockquote></div><br>