RE: UNION ALL Query: Riddle

2004-01-29 Thread Jared Still
lem like you Rajesh, the query also gives different > rowcount each time executed eventhough there's no one updating base > tables, in my opinion it's because of the sorting operation (your group > by clause). In my case after I remove some group functions, the result > goes we

RE: UNION ALL Query: Riddle

2004-01-29 Thread Wendry
I have the same problem like you Rajesh, the query also gives different rowcount each time executed eventhough there's no one updating base tables, in my opinion it's because of the sorting operation (your group by clause). In my case after I remove some group functions, the result goes

RE: UNION ALL Query: Riddle

2004-01-28 Thread Jared Still
It would be my guess that someone was doing DML on your table while you're running the first query, and you don't see the results of that until the second query. Try running your SQL statement twice in a single transaction and see if the results are the same then. eg. rollback; set t

RE: UNION ALL Query: Riddle

2004-01-28 Thread Pillai, Rajesh
PROTECTED]Sent: Tuesday, January 27, 2004 2:29 PMTo: Multiple recipients of list ORACLE-LSubject: Re: UNION ALL Query: RiddleQ:  What does "different results" mean? Different row count? Completely different data? Partially different data? Some columns have incorrect value? What abou

Re: query plan is bad when it is run inside a pl/sql stored

2004-01-27 Thread S.Sarkar
it is the same. '%TATA.COM' is not a variable. sumant --- Wolfgang Breitling <[EMAIL PROTECTED]> wrote: > Is the sql really "the same query is run from a stored > procedure" or is it > perhaps using in place of the '%TATA.COM' a plsql variable &g

Re: UNION ALL Query: Riddle

2004-01-27 Thread Jared . Still
"Pillai, Rajesh" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED]  01/27/2004 01:09 PM  Please respond to ORACLE-L                 To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>         cc:                 Subject:        UNION ALL Query: Riddle H

UNION ALL Query: Riddle

2004-01-27 Thread Pillai, Rajesh
Hi All, The following query is giving different results in each run. I assure that no data modified between consecutive runs - INSERT /* append parallel (z,8) */ INTO some_table (SELECT /*parallel (a,8) */ a.item, a.loc

Re: query plan is bad when it is run inside a pl/sql stored

2004-01-27 Thread Wolfgang Breitling
Is the sql really "the same query is run from a stored procedure" or is it perhaps using in place of the '%TATA.COM' a plsql variable (which is set to %TATA.COM)? At 04:44 AM 1/27/2004, you wrote: All, i have this query: SELECT count(1) FROM ats.emktg_members t1 WHERE NO

Re: query plan is bad when it is run inside a pl/sql stored procedure

2004-01-27 Thread Mladen Gogala
It's a bad query that could probably be resolved throuh an analytic function but I don't normally delve into things like that before having finished my 2nd coffee. You can use hints, in particular, there is a hint to force hash join. On 01/27/2004 06:44:25 AM, S.Sarkar wrote: All, i

query plan is bad when it is run inside a pl/sql stored procedure

2004-01-27 Thread S.Sarkar
All, i have this query: SELECT count(1) FROM ats.emktg_members t1 WHERE NOT EXISTS ( SELECT 'x' FROM gcd_data_source_details t2 WHERE t2.universal_id = t1.universal_id AND t2.data_source_id = 13 ) AND upper(t1.email) NOT LIKE '%TATA.COM'; This query finishes in

Re: Parallel Query determined by?

2004-01-21 Thread Kirtikumar Deshpande
MAIL PROTECTED] > Sent by: [EMAIL PROTECTED] > 01/20/2004 11:29 AM > Please respond to ORACLE-L > > > To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> > cc: > Subject:Parallel Query determined by? > > > I

Re: Parallel Query determined by?

2004-01-20 Thread Jared . Still
by: [EMAIL PROTECTED]  01/20/2004 11:29 AM  Please respond to ORACLE-L                 To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>         cc:                 Subject:        Parallel Query determined by? I've inherited a system that has a whole lot of indexes

Parallel Query determined by?

2004-01-20 Thread mkline1
I've inherited a system that has a whole lot of indexes set to degree 10 and many tables set to 2 & 4. The users are complaining that Precise is showing a whole lot of time in "Parallel Sync Wait". It is an HP box running 8.1.7.4 with 16 processors. The box is normally not very busy. Are there

RE: Strange Query Result,... urgent please

2004-01-18 Thread Wendry
: Saturday, January 17, 2004 2:59 PM To: LazyDBA.com Discussion Dear All, I need help on the following query, the following has been simplified to show you the exact problem. Due to this error, the sql query is giving unstable result which affects on production reporting in my company. I wonder what&

Re: Strange Query Result,... urgent please

2004-01-17 Thread Tanel Poder
L" <[EMAIL PROTECTED]> Sent: Saturday, January 17, 2004 3:54 PM > > > Dear All, > > I need help on the following query, the following has been simplified to > show you the exact problem. Due to this error, the sql query is giving > unstable result which affect

Strange Query Result,... urgent please

2004-01-17 Thread Wendry
Dear All, I need help on the following query, the following has been simplified to show you the exact problem. Due to this error, the sql query is giving unstable result which affects on production reporting in my company. I wonder what's the real problem? SQL> SELECT COUNT(1)

Re:RE: Re: A STRANGE QUERY

2004-01-14 Thread system manager
uld guess that there is something foobarred with the >primary key index. > >I would rebuild the primary key and try again. > >Brad O. > > >-Original Message- >Sent: Monday, January 12, 2004 4:45 PM >To: Multiple recipients of list ORACLE-L > > >It is

RE: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Rohan Karanjawala
lt;[EMAIL PROTECTED]> Subject: SQL Query Problem(possilble duplicate send, Sorry!) Date: Tue, 13 Jan 2004 12:34:35 -0800 Hello all, I am working with a query that does some counts. I've hit a brick wall and can't get passed trying to figure out how I can make the query show percentages

Re: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Bricklen Anderson
Viktor wrote: Thanks for your reply! Will try it now. Will this work in 8i? Viktor If it works at all, then it should work in both 8i and 9i, although I don't have a version of 8i handy right now to try this on. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Brickl

Re: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Viktor
Thanks for your reply! Will try it now. Will this work in 8i?   Viktor   Bricklen Anderson <[EMAIL PROTECTED]> wrote: Viktor wrote:> Hello all,> > I am working with a query that does some counts. I've hit a brick wall > and can't get passed trying to figure out h

Re: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Bricklen Anderson
Viktor wrote: Hello all, I am working with a query that does some counts. I've hit a brick wall and can't get passed trying to figure out how I can make the query show percentages %. Here is the query: select "COUNTRY", count ("MSS") "

SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Viktor
Hello all, I am working with a query that does some counts. I've hit a brick wall and can't get passed trying to figure out how I can make the query show percentages %. Here is the query: select "COUNTRY",    count ("MSS") "COUNT_MSS"FROM ( SELEC

RE: Re: A STRANGE QUERY

2004-01-13 Thread Odland, Brad
At first stab...I would guess that there is something foobarred with the primary key index. I would rebuild the primary key and try again. Brad O. -Original Message- Sent: Monday, January 12, 2004 4:45 PM To: Multiple recipients of list ORACLE-L It is not an expensive query.It

Re:Re: A STRANGE QUERY

2004-01-12 Thread system manager
It is not an expensive query.It runs really fast without the primary key in production but we dont have this problem in the test instance. -- Original Message Date: Mon, 12 Jan 2004 14:04:42 -0800 >Even stranger is, that you expect us to solve y

Re: A STRANGE QUERY

2004-01-12 Thread Mladen Gogala
On 01/12/2004 03:54:27 PM, system manager wrote: > Dear List, > > I have a very strange query: > > The table, data, indexes, constraints are set up exactly same > The query was running ok in the test database but paused the production > system. > It is also running

Re: A STRANGE QUERY

2004-01-12 Thread Mark Richard
Dear "system mamager", You have given very little to work from. Is the query a SELECT, UPDATE, INSERT or DELETE? Can you produce explain plans for the query on both systems? What made you consider disabling the primary key on production (this sounds like a bold / crazy move, bu

Re: A STRANGE QUERY

2004-01-12 Thread Tanel Poder
Even stranger is, that you expect us to solve your problem without knowing what exactly the problem is! Does your query consist of a SQL statement? Does it have an execution plan? Very strange, indeed. Tanel. > Dear List, > > I have a very strange query: > > The table

A STRANGE QUERY

2004-01-12 Thread system manager
Dear List, I have a very strange query: The table, data, indexes, constraints are set up exactly same The query was running ok in the test database but paused the production system. It is also running ok in production if the primary key disabled. Any ideas? Any input will be greatly

RE: rewrite group by query

2004-01-06 Thread Rohan Karanjawala
try this out select a, b from (select a from tab1 group by a having count(*)=1) alias where a in alias; regds, Rohan From: "elain he" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> Subject: rewrite group by q

Re: rewrite group by query

2004-01-05 Thread Boris Dali
How about select * from (select tab1.*, count(a) over(partition by a) a_count from tab1) where a_count =1; ... would probably save you one pass over tab1. Thanks, Boris Dali. --- elain he <[EMAIL PROTECTED]> wrote: > Hi, > Does anyone have a better way of rewriting the > follo

rewrite group by query

2004-01-05 Thread elain he
Hi, Does anyone have a better way of rewriting the following query? I'm trying to avoid querying the table, tab1 twice. select a, b from tab1 where a in (select a from tab1 group by a having count(*)=1); Thanks. elain _ Make

RE: Misbehaving query

2003-12-12 Thread Bobak, Mark
et? Hope that helps, -Mark -Original Message- Sent: Friday, December 12, 2003 3:05 PM To: Multiple recipients of list ORACLE-L Hi! I have a query that I think is behaving oddly; and, it may just be that I'm blind and am doing something silly (*there's* a first!), or it ma

Re: Misbehaving query

2003-12-12 Thread Mladen Gogala
No problem. You are trying to create a cartesian product of the two queries. Now, what is a Cartesian product of the two sets, A and B? It is a set of all ordered pairs (a,b) where a is element of A and b is element of B. The result of your firs query is an ampty set: SQL> select * from j

Re: Misbehaving query

2003-12-12 Thread Vladimir Begun
Bellow, Bambi wrote: SQL> select a.*, b.* 2 from 3 ( select * from junk minus select * from junk2 ) a, 4 ( select * from junk2 minus select * from junk ) b; no rows selected SELECT a.* , b.* FROM (SELECT dummy x FROM dual WHERE 1 = 2) a , (SELECT dummy x FROM dual) b WHERE b.x

RE: Misbehaving query

2003-12-12 Thread Bellow, Bambi
sense to me. Carol Bristow DPRA Inc. 1300 N 17th St Suite 950 Rosslyn, VA 22209 Work: 703-841-8025 Fax: 703-524-9415 -Original Message- Sent: Friday, December 12, 2003 3:05 PM To: Multiple recipients of list ORACLE-L Hi! I have a query that I think is behaving oddly; and, it may just be that

RE: Misbehaving query

2003-12-12 Thread Scott Canaan
e to me. Carol Bristow DPRA Inc. 1300 N 17th St Suite 950 Rosslyn, VA 22209 Work: 703-841-8025 Fax: 703-524-9415 -Original Message- Sent: Friday, December 12, 2003 3:05 PM To: Multiple recipients of list ORACLE-L Hi! I have a query that I think is behaving oddly; and, it may just be tha

RE: Misbehaving query

2003-12-12 Thread Carol Bristow
Message- Sent: Friday, December 12, 2003 3:05 PM To: Multiple recipients of list ORACLE-L Hi! I have a query that I think is behaving oddly; and, it may just be that I'm blind and am doing something silly (*there's* a first!), or it may be environment specific, but, I'm thinkin it ma

Misbehaving query

2003-12-12 Thread Bellow, Bambi
Hi! I have a query that I think is behaving oddly; and, it may just be that I'm blind and am doing something silly (*there's* a first!), or it may be environment specific, but, I'm thinkin it may just be a bug. I have filed a TAR with Oracle, and they keep sending workarounds, w

RE: Query temp segments blank

2003-11-26 Thread mkline1
Below was the closest I got, but it still pretty much shows everything "empty" sort of. Guess it's okay, I'll monitor. This is a warehouse so it's hard to say. So close to the holidays, it's possible they aren't using a lot of temp. set linesize 162 set pagesize 30 column tablespace_name forma

RE: Query temp segments blank

2003-11-26 Thread Vergara, Michael (TEM)
vember 26, 2003 6:00 AM To: Multiple recipients of list ORACLE-L It appears one database I can not query the temp tablespace. It's local, unform extents, but nothing shows up in dba_segments or any where I have found thus far. Has this progressed to a "trust me" type of situatio

Query temp segments blank

2003-11-26 Thread mkline1
It appears one database I can not query the temp tablespace. It's local, unform extents, but nothing shows up in dba_segments or any where I have found thus far. Has this progressed to a "trust me" type of situation? Even TOAD gives me nothing but blanks on objects in TE

Re: _wait_for_sync , dirty buffer flushing and direct reads in parallel query

2003-11-20 Thread Anjo Kolk
on your situation. Anjo. - Original Message - To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Wednesday, November 19, 2003 11:20 PM query > Hi! > > I've sometimes used setting _wait_for_sync=false during Apps upgrade > projects, to

_wait_for_sync , dirty buffer flushing and direct reads in parallel query

2003-11-19 Thread Tanel Poder
Hi! I've sometimes used setting _wait_for_sync=false during Apps upgrade projects, to upgrade performance. (As long as your database doesn't crash during the parameter is set to false, no problems should occur). I just started wondering, what would be the case if a parallel query sta

Re: SQL Query

2003-11-14 Thread Binley Lim
, November 15, 2003 1:19 PM Subject: Re: SQL Query Sorry, don't understand the DBA part ( #2 ). "Binley Lim" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED]  11/14/2003 02:09 PM  Please respond to ORACLE-L

Re: SQL Query

2003-11-14 Thread Jared . Still
        Subject:        Re: SQL Query Would have thought:   1. A developer would have known this - a SQL many-to-many join   2. A DBA would have known this - how else would you know what's happening with your tablespaces? (Clickety-pointy answers not allowed)   - Original Message --

RE: SQL Query

2003-11-14 Thread Jared . Still
list ORACLE-L <[EMAIL PROTECTED]>         cc:                 Subject:        RE: SQL Query Jared -- That is expected behavior for this query.  What was weird is that I expected the aggregation in the group by to apply to multiple fileids making GROUP BY a.tablespace_name, b.tablespace_nam

Re: SQL Query

2003-11-14 Thread Binley Lim
To: Multiple recipients of list ORACLE-L Sent: Saturday, November 15, 2003 9:54 AM Subject: Re: SQL Query You can't join DBA_EXTENTS and DBA_DATA_FILES based on an equality of tablespace_name, and then add up the bytes of the files for the tablespace. ie

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
Jared -- That is expected behavior for this query.  What was weird is that I expected the aggregation in the group by to apply to multiple fileids making GROUP BY a.tablespace_name, b.tablespace_name to be able, then, to join a.tablespace_name to b.tablespace_name as a 1-1 join rather than

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
much too big. For files in that case its 3 times too big for each, and for extents two times too big for each. By contrast, the inline views in the query which works force the aggregates to be computed _before_ the final calculation. SF "Bellow, Bambi" wrote: > > But Stephane

Re: SQL Query

2003-11-14 Thread Jared . Still
You can't join DBA_EXTENTS and DBA_DATA_FILES based on an equality of tablespace_name, and then add up the bytes of the files for the tablespace. ie.   select    b.tablespace_name,    b.bytes from dba_extents a, dba_data_files b where a.tablespace_name=b.tablespace_name Try running that

RE: SQL Query

2003-11-14 Thread Ron Thomas
] [EMAIL PROTECTED]cc: .com Subject: RE: SQL Query

Re: SQL Query

2003-11-14 Thread Stephane Faroult
its 3 times too big for each, and for extents two times too big for each. By contrast, the inline views in the query which works force the aggregates to be computed _before_ the final calculation. SF "Bellow, Bambi" wrote: > > But Stephane, I am aggregating by tablespace for both

RE: SQL Query

2003-11-14 Thread Smith, Ron L.
hts reserved. Connected to: Oracle7 Server Release 7.3.4.4.0 - Production With the distributed and parallel query options PL/SQL Release 2.3.4.4.0 - Production Total Used Free Pct Largest N

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
I encountered the same issues. Also, just to make things interesting, if you replace DBA_EXTENTS with DBA_FREE_SPACE, the number of MEGS_ALLOCATED is different. Still wrong, mind you, but different. None of this makes any sense to me. My bet is that I got me a bug. Bambi. -Original Messag

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
, November 14, 2003 1:09 PM To: Multiple recipients of list ORACLE-L Bambi, Your second query is wrong because all extents in a tablespace don't necessarily belong to the same datafile. Try the query without the aggregate functions and the GROUP BY, and you'll understand your mistake.

RE: SQL Query

2003-11-14 Thread Ron Rogers
Bambi, I tried your sql on my test server and the used space is the same. here are the results. The ALLOCATED and PCT are way out, I'm looking. 1 select a.tablespace_name,megs_allocated,megs_used,round(megs_used/b.megs_allocated,2)*100 pct 2 from (select tablespace_name,sum(bytes)/(1024*102

RE: SQL Query

2003-11-14 Thread Paul Baumgartel
Odder still, I get inconsistent results. megs_allocated is always wrong, but megs_used is right when run against one tablespace, wrong against another: TABLESPACE_NAMEMEGS_ALLOCATED MEGS_USEDPCT -- -- -- -- MEDIUM_DA

Re: SQL Query

2003-11-14 Thread Stephane Faroult
Bambi, Your second query is wrong because all extents in a tablespace don't necessarily belong to the same datafile. Try the query without the aggregate functions and the GROUP BY, and you'll understand your mistake. HTH, SF "Bellow, Bambi" wrote: > > Friends -

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
, November 14, 2003 12:44 PM To: Multiple recipients of list ORACLE-L Bambi, I think that the query (2) will return the the same count as query (1) if you use the column user_bytes from the dba_data_files rather than the column bytes. If I sum the bytes from dba_extents for a tablespace_name xx

Re: SQL Query

2003-11-14 Thread Ron Rogers
Bambi, I think that the query (2) will return the the same count as query (1) if you use the column user_bytes from the dba_data_files rather than the column bytes. If I sum the bytes from dba_extents for a tablespace_name xxx and sum the user_bytes from dba_data_files for tablespace_name xxx I

SQL Query

2003-11-14 Thread Bellow, Bambi
Friends -- Why would these two queries return different results? This query works. SQL> l 1 select a.tablespace_name,megs_allocated,megs_used,round(megs_used/b.megs_allocated, 2)*100 pct 2 from (select tablespace_name,sum(bytes)/(1024*1024) megs_used 3 from dba_extents group

query question ( top 1) ORA-00904

2003-11-10 Thread Teresita Castro
Hi!! I am doing a query that have to result the top 1 from a nother query. When I run the query it returns me this error:  ORA-00904: "TB_EDORESULT"."ITEM":invalid idenfier   First I was thinking that was because something was misspell, so I put comment (--) infr

query rewrite doesn't work if based on a regular view

2003-11-09 Thread chuan . zhang
Dear All, query rewrite doesn't work on materialized view if based on a regular view which contains joins and coorelated subquery. Got the the following message: QSM-01063: query has a dictionary table or view QSM-01019: no suitable materialized view found to rewrite this query. I cre

Antw: export with query date field

2003-11-06 Thread Guido Konsolke
David, your query will get all records where the time is '00' (hh24miss) -> MIDNIGHT. You need to deal with the time portion. hth, Guido >>> [EMAIL PROTECTED] 06.11.2003 22.54 Uhr >>> List, I am trying to do an export query with a date field. I have tired

Re: export with query date field

2003-11-06 Thread Jared . Still
PM  Please respond to ORACLE-L                 To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>         cc:                 Subject:        export with query date field List, I am trying to do an export query with a date field.  I have tired different syntax.  I know th

RE: export with query date field

2003-11-06 Thread Jamadagni, Rajendra
[EMAIL PROTECTED]> exp system file=aud.dmp log=aud.log tables=user_logon_audit query=\"where trunc\(logon_time\) = to_date\(\'20031105\',\'mmdd\'\)\" Export: Release 9.2.0.2.0 - Production on Thu Nov 6 17:11:41 2003 Copyright (c) 1982, 2002, Oracle Corporatio

export with query date field

2003-11-06 Thread Ehresmann, David
List, I am trying to do an export query with a date field. I have tired different syntax. I know there are 500+ records with a date of 11/06/2003 in this table. What is wrong with my query since it returns no records? I have done this with character fields with no problem. What am I missing

Re: query taking a long time to run via sqlnet

2003-11-06 Thread M.Godlewski
SmithYNG>952117400012EINESS_FLAG>N9521174000121TYPE>576931001022ADING>NNNATE_BILL>YNNT_CARD_REQD>JT>';     pkg_ice_guto.sp_perform_guto(p_xml_in, p_xml_out); EXCEPTIONWHEN OTHERS THEN    dbms_output.put_line(SubStr('Error '||TO_CHAR(SQLCODE)||': &

Re: query taking a long time to run via sqlnet

2003-11-06 Thread Zabair Ahmed
52117400012EINESS_FLAG>N9521174000121TYPE>576931001022ADING>NNNATE_BILL>YNNT_CARD_REQD>JT>';     pkg_ice_guto.sp_perform_guto(p_xml_in, p_xml_out); EXCEPTIONWHEN OTHERS THEN    dbms_output.put_line(SubStr('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM, 1,

query taking a long time to run via sqlnet

2003-11-05 Thread Zabair Ahmed
ice_guto.sp_perform_guto(p_xml_in, p_xml_out); EXCEPTIONWHEN OTHERS THEN    dbms_output.put_line(SubStr('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM, 1, 255));RAISE;END;/   The same query when I run it via a client/server connection takes fore ever to run, it's been almost 2hrs and it's s

question parallel query used by SMON

2003-10-31 Thread Ryan
Im studying for the backup and recovery exam. One quesiton from self test software states that SMON will use parallel query when it detects a dread transaction with a 'large number' of rollback blocks.   my questions:   1. is the number of parallel query slaves it uses based on m

RE: rewriting query without using UNION

2003-10-29 Thread Rudy Zung
there's a better way of writing the query below. Basically, I would like to return employee records where employee name='JOSE' + all employees in deptno=50. My query can have multiple 'OR' criterias where the next criteria maybe returning all employees with salary>6 i

Re: rewriting query without using UNION

2003-10-29 Thread ryan_oracle
: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> > Subject: rewriting query without using UNION > > Hi, > I wonder if there's a better way of writing the query below. Basically, I > would like to return employee records where employee name='JOSE' + all

Re: rewriting query without using UNION

2003-10-29 Thread Mladen Gogala
I don't see why would query with multiple unions necessarily degrade performance, but here is another way for writing your query: select e.id, e.name, d.deptname from emp e, dept d where e.deptno=d.deptno and ( e.name='JOSE' or d.deptno=50) / That would be a union of all emp

RE: Date-based query Q

2003-10-29 Thread Aidan Whitehall
Thanks for everyone's help with this one, btw. In the end I bit the bullet and added a dates table. -- Aidan Whitehall Macromedia ColdFusion Developer Fairbanks Environmental Ltd +44 (0)1695 51775 Queen's Awards Winner 2003 ___

rewriting query without using UNION

2003-10-29 Thread Linda Wang
Hi, I wonder if there's a better way of writing the query below. Basically, I would like to return employee records where employee name='JOSE' + all employees in deptno=50. My query can have multiple 'OR' criterias where the next criteria maybe returning all emplo

RE: RE: Date-based query Q

2003-10-29 Thread Mercadante, Thomas F
day (between day x and day y) and need a >record set that also >includes a row for those days which have no >records: > >UkDate Total >1/1/20035 >2/1/20036 >3/1/20030 >4/1/20036 > >I could post-process the record set to achieve >

RE: RE: Date-based query Q

2003-10-29 Thread Stephane Faroult
UkDate Total >1/1/2003 5 >2/1/20036 >3/1/20030 >4/1/20036 > >I could post-process the record set to achieve >this, but is there any >way in 9i to do an aggregate query with an outer >join on a date range >(if that makes sense)? >

Re: Date-based query Q

2003-10-29 Thread Jonathan Gennick
: AW> UkDate Total AW> 1/1/20035 AW> 2/1/20036 AW> 3/1/20030 AW> 4/1/20036 AW> I could post-process the record set to achieve this, but is there any AW> way in 9i to do an aggregate query with an outer join on a date range AW> (if that makes

RE: Date-based query Q

2003-10-29 Thread Nicoll, Iain
cord set that also includes a row for those days which have no records: UkDate Total 1/1/20035 2/1/20036 3/1/20030 4/1/20036 I could post-process the record set to achieve this, but is there any way in 9i to do an aggregate query with an outer join on a date range

Date-based query Q

2003-10-29 Thread Aidan Whitehall
cords: UkDate Total 1/1/20035 2/1/20036 3/1/20030 4/1/20036 I could post-process the record set to achieve this, but is there any way in 9i to do an aggregate query with an outer join on a date range (if that makes sense)? Someone made the suggestion of creating an

tuning a co-related query howto

2003-10-28 Thread hrishy
where Address_IDX = PA.Address_Key and (CHANGEDDT-to_date('10/22/2003 18:02:30','mm/dd/ hh24:mi:ss'))<=0.001 ) call count cpuelapsed disk query

RE: Query Tuning Help

2003-10-27 Thread Niall Litchfield
PMFJI >>How about optimizer parameters (optimizer_index_caching,optimizer_index_cost_adj)? optimizer_index_caching=0 < Um no probably not. O_i_c says (in Niall english) what percentage of my index blocks are likely to be in memory rather than on disk. The *baseline* for this is BCHR (or say

RE: Query Tuning Help

2003-10-27 Thread David Wagoner
Title: RE: Query Tuning Help Mladen, Thanks for your response.  Comments are in-line. >>Do you have "query rewrite" privilege? Yes. >>What is the query_reqrite_inegrity set to? TRUSTED. >>How about optimizer parameters (optimizer_index_cach

RE: Query Tuning Help

2003-10-27 Thread Stephane Faroult
David, I would probably not try to tune a query to make it use an index but tune a query to make it run faster - I have had recently a nice example, a join between a 500K row table and two 2K row tables (returning about 2K rows too) was running faster with FTS (followed by hash joins) on

RE: Query Tuning Help

2003-10-27 Thread David Wagoner
Title: Query Tuning Help The FILE_DTS column is VARCHAR2(12) NOT NULL and has data in the following format:  07220301.   Best regards, David B. Wagoner Database Administrator Arsenal Digital Solutions Phone: 919-466-6723 Cell: 919-412-8462 Pager: [EMAIL PROTECTED] Fax: 919

Re: Query Tuning Help

2003-10-27 Thread Mladen Gogala
Do you have "query rewrite" privilege? What is the query_reqrite_inegrity set to? How about optimizer parameters (optimizer_index_caching,optimizer_index_cost_adj)? Is everything analyzed? On 10/27/2003 10:34:26 AM, David Wagoner wrote: I'm trying to tune the following query

RE: Query Tuning Help

2003-10-27 Thread David Wagoner
Title: Query Tuning Help Tom,   Thanks for the init.ora parameter tips, I consulted the docs and did that first :-).  It just seems that the CBO would rather use an index, even though I know that's not always the case.   Best regards, David B. Wagoner Database Administrator Arsenal Di

RE: Query Tuning Help

2003-10-27 Thread Mercadante, Thomas F
Title: Query Tuning Help   David,   The calculation "(> SYSDATE - 35)" is not causing the problem.  The To_Date(a2.file_dts, 'mmddyyhh24miss') is.   You said you created a function based index.  I think you also need to set:   Query_ReWrite_Integrity = TRUST

Re: Query Tuning Help

2003-10-27 Thread ryan_oracle
because its not always faster to use an index. try using a hint for the index and see which runs better. > > From: David Wagoner <[EMAIL PROTECTED]> > Date: 2003/10/27 Mon AM 10:34:26 EST > To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> > Subject: Query

Query Tuning Help

2003-10-27 Thread David Wagoner
Title: Query Tuning Help I'm trying to tune the following query to use an index on the FILE_DTS column, rather than a FTS on the CLASS_CONFIG table (~350,000 rows). SELECT  a2.class_config_id, a1.schedule_name FROM    class_config a2, class_schedule a1 WHERE a2.class_config_id

Another query problem in 9i

2003-10-22 Thread Guang Mei
Hi: I have another problem that I have been trying to solve. I have this query that works perfectly in 8i, but does not work in 9i. The query is -- not working in 9i but works in 8i: select distinct arc.TermID, arc.ParentTermID fromarc connect by prior

RE: Query question

2003-10-15 Thread Jacques Kilchoer
asktom.oracle.com http://asktom.oracle.com/pls/ask/f?p=4950:8:2542717627406446060::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:124812348063, or http://tinyurl.com/r3lk "pivot a result set" -Original Message- Teresita Castro I have the next query: SELECT COMP

Query question

2003-10-15 Thread Teresita Castro
Hi!!I have the next query: SELECT COMPANY,  ITEM, OEBASE.CUR_PRICE_01   FROM OEBASEWHERE OEBASE.COMPANY IN (2000,2001,2002) AND OEBASE.BASE_NAME IN ('BASE-OCJ', 'BASE-OSI','BASE-OCR')   This returns for each item three lines2000 0010041  12.342001 0010041  12.7

use of TEMP tables to re-query HTML form fields

2003-10-10 Thread rahul
e values "re-apprear" on the second page ?? the solution: use of TEMP tables, we use temp table to hold the values, each tikme the user clicks "next page" we save the values to the temp table, and re-query to fill in the fields if the user comes back to the same page .. is

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Rothouse, Michael
Title: Message select ip, max(timestamp) from table group by ip; -Original Message-From: Johan Muller [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 10:45 AMTo: Multiple recipients of list ORACLE-LSubject: Sql query : select max timestamp value from table

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Melanie Caffrey
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johan Muller Sent: Thursday, October 02, 2003 10:45 AM To: Multiple recipients of list ORACLE-L Subject: Sql query : select max timestamp value from table   I have multiple timestamps values  for single ip in a table, I need the max(timestamp)  for

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Whittle Jerome Contr NCI
Title: RE: Sql query : select max timestamp value from table   select ip, max(timestamp) from table   group by ip; Jerry Whittle ASIFICS DBA NCI Information Systems Inc. [EMAIL PROTECTED] 618-622-4145 -Original Message- From:   Johan Muller [SMTP:[EMAIL PROTECTED] I have

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Khedr, Waleed
select ip, max(timestamp) from table group by ip; -Original Message-From: Johan Muller [mailto:[EMAIL PROTECTED]Sent: Thursday, October 02, 2003 10:45 AMTo: Multiple recipients of list ORACLE-LSubject: Sql query : select max timestamp value from table I have multiple

Re: Sql query : select max timestamp value from table

2003-10-02 Thread Daniel Fink
Johan, First, you don't need the distinct. The proper query will return 1 row per ip. Second, take the max(timestamp) out of the group by. That is causing the problem. Daniel Johan Muller wrote: > I have multiple timestamps values for single ip in a table, I > need the max(time

  1   2   3   4   5   6   7   8   9   10   >