Aggregation/duplicate elimination bug in 8.1.6

Looks like something funny happening with
the optimizer here. Anyone know if this
is fixed in a later release?
-dll
SQL*Plus: Release 8.1.6.0.0 - Production on Tue Sep 4 17:57:37 2001
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
SQL> rem Create a table and put two rows into it.
SQL> create table t (c1 number, c2 number, c3 number);
Table created.
SQL> insert into t (c1, c2, c3) values (1201, 13.196632, 17.7637174);
1 row created.
SQL> insert into t (c1, c2, c3) values (1201, 13.196632, 17.7637174);
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL> rem Create a view on the table.
SQL> create view v2 as
2 select v1.c0 as c0, v1.c1 as c1,
3 sum(v1.c2) over (partition by v1.c0
4 order by v1.c1
5 rows between unbounded preceding and current row) as c2
6 from (select distinct v0.c1 as c0, v0.c2 as c1, v0.c3 as c2 from t v0) v1;
View created.
SQL>
SQL> rem Show the view results.
SQL> rem Note the largest value of c2.
SQL> select * from v2;
C0 C1 C2
1201 13.196632 17.7637174
SQL>
SQL> rem Now issue an aggregate query on the view to
SQL> rem return the max of c2.
SQL> rem Note that this is the wrong result. Apparently
SQL> rem the duplicate elimination was forgotten.
SQL> select v2.c0 as c0, v2.c1 as c1, max(v2.c2) as c2
2 from v2 v2
3 group by v2.c0, v2.c1;
C0 C1 C2
1201 13.196632 35.5274348
SQL>
SQL> rem If we add another grouped expression to the select list,
SQL> rem the results for c2 become correct, however.
SQL> 1
1* select v2.c0 as c0, v2.c1 as c1, max(v2.c2) as c2
SQL> a , count(v2.c2) as c3
1* select v2.c0 as c0, v2.c1 as c1, max(v2.c2) as c2, count(v2.c2) as c3
SQL> /
C0 C1 C2 C3
1201 13.196632 17.7637174 1
SQL>
null

I can confirm the same problem in 8.1.7.1.0.

Similar Messages

  • LMS4.1 aggregated duplicate MAC-Report

    Hello,
    We want to quickly identify ports with probably attached mini-switches/hubs. Does a report type exist in LMS4.1 showing duplicate MACs aggregated with its count of occourence, not line by line?
    Is it planed to bring out basic aggragate functions (avg,min,max,sum,count) into LMS/PI Report-Generator to be able for a real flexible reporting without the need for accessing database directly?
    Steffen

    I can't disagree with your logic, I guess I just assumed such an enterprise solution (that is FAR from cheap) wouldn't require an export of my close to 20,000 records to a .csv in order to do simple sorting.
    I will continue to look for a solution within the application, but if worse comes to worse i guess an export could suffice for some of what i'm trying to do.

  • "Show Duplicate Frames" bug

    ... does anyone know if this bug has been fixed in FCP 6 ...
    i just started a project and noticed my asst. had the "show duplicate frames" on and it spooked me ...
    R.

    ... there were issues (i think i 4 or 4.5) with it making sequences unworkably sluggish if the "show duplicate frames" option was chosen; when it was turned on it meant lots of waiting for the beachball whenever clips or cuts were moved and it was essentially unusable because of this.
    R.

  • Duplicate eliminator for new Photos

    Is it safe to use duplicate eliminators designed for iPhoto on the new PHOTOS? ANy recommendations?

    I only know of two duplicate finders for Photos:
    Power photos   http://www.fatcatsoftware.com/powerphotos/   or Introducing : Duplicate Annihilator for Photos  http://brattoo.com/propaganda/
    Both tools are the successors to highly recommended tools for iPhoto, and the developers have been very reliable.

  • Duplicate Elimination in ebMS

    Hello,
    One of our partners is requesting to activate DuplicateElimination when sending ebXML messages to them.
    However in Oracle 10g b2b, I can't find that parameter.
    Does anyone know if this parameter can be enabled ?
    Kind regards,
    Guido

    Hi Guido,
    I am not very sure that from which patch this functionality is supported but I had worked with MLR#5 and there it was supported and editable. But one thing is for sure that you won't get many functionalities without upgrading your AS with first patch (Oracle AS 10.1.2.3 - 5983622).
    It is always advised to be on the latest patch to get maximum functionalities and to avoid known issues. Latest MLR released is MLR 12 (8703404) and MLR 13 is coming soon.
    Please apply above two patches as I mentioned in my last post and then retry.
    Let us know the result please.
    Regards,
    Anuj

  • Duplicate of "Bug in CREATE_COLLECTION_FROM_QUERYB2?" - please delete

    for some reason this had been posted twice, sorry for that.
    Edited by: Andreas Wismann on 19.09.2011 13:50

    Hi Joel,
    I see... thanks for your support. I'm just writing a helper package for tabular forms (that's why I was using 10 empty columns "for future use").
    This does work:
       apex_collection.CREATE_COLLECTION_FROM_QUERYB2
           p_collection_name => 'QUERYB2'
          ,p_query => 'select '
                    || '0 n001, 0 n002, 0 n003, 0 n004, 0 n005, null d001, null d002, null d003, null d004, null d005,'
                    || ' ''Dummy'' '
                    || ' from dual '
                    || ' where 1 = :TEST'
          ,p_names => apex_util.string_to_table('TEST')
          ,p_values => apex_util.string_to_table('1')
          ,p_max_row_count => 1
       );

  • No "skip duplicates" after 10.4.3?

    I updated to Mac OS X 10.4.3 yesterday, and today, while I'm on vacation, iPhoto 5.0.4 re-imports ALL the pictures on my compact flash card each time I insert it into my card reader. Previously, I would get a dialog asking me if I wanted to import or skip duplicates. This dialog no longer appears. It's happened twice today and it's kind of annoying when you have 700+ pictures on your 1GB card. The card appears to mount and works otherwise. I just don't want to have to keep deleting 700MB of pictures each time I import some more. Has anyone else seen this or knows a work around? I know how to use the Image Capture to select only the pictures I want, but you STILL have to delete them from the destination folder after dragging them into iPhoto if you do that...
    -Doug

    I don't think that this has to do with updating to 10.4.3 -- because my daughter's iMac G5 is on 10.4.2 (mainly because she is constantly using it and won't let me near it long enough to update things of late ... so far I need to update her iTunes from 5 to 6, do the 10.4.2 => 10.4.3 update, and update Quicktime -- I manage to sneak in backups at least while she is in the shower) and I noticed that it seems to import duplicates without asking if that is ok or not, so they have to be manually deleted. Meanwhile, on our older iMac 500MHz G3 running iPhoto 4.0.3 asks every time if I want to import duplicates and doesn't import them if I say no ...
    Old Toad's scheme of inputing new photos seems to make sense and it gets around the "duplicate import" bug that seems to affect some but not all users of iPhoto.

  • I want to use The Duplicate Finder to get rid of duplicates in iphoto. I created a library as a folder on my desktop.  Should I trash the photos in iphoto before I run the duplicate finder?

    I want to use The Duplicate Finder to get rid of duplicates in iphoto. I created a library as a folder on my desktop and droped it into Dupe Finder.  Many dupes were found.  Before I have it auto select dupes, should I trash the photos in iphoto?  Or will Dupe Finder do that for me automatically?

    1 - if you want to remove duplicates from your iPhoto library you would not be using a copy of it
    2 - don't do anything without a good, current backup
    3 - reading the Duplicate Finder web site does not tell me tha tit is safe to use on the iPhoto library - i suggest you use one of the known good and tested duplicate eliminations programs - see this discussion for links - https://discussions.apple.com/message/24363132#24363132
    4 - One cardinal rule - NEVER make any chnages to the structrure or content of the iPhoto library using any porogram (including the finder) other than iPhoto - the programs listed in the linked discussion use iPhoto to do the deleting
    LN

  • Select query that eliminate duplicates

    I am struck at the below scenario. need your help in modify my query based on the below sample data. My objective is to create a EVENT AND EVENT_LOW using the data available from TEM_GT and TXN table.
    TEM_GT (global temporary table)
    est_id primary key, trans_id, trp_id, amount
    1 111 2221 1.5
    2 111 3332 2.0
    3 112 4443 3.0
    TXN table
    trans_id, trans_type
    111 type1
    112 type1
    EVENT table
    event_id primary key, trans_id, trans_type, flag.
    1000 111 type1 N
    1001 112 type1 N
    EVENT_LOW table
    event_low_id primary key, event_id, est_id, amount.
    9991 1000 1 1.5
    9992 1000 1 2.0
    9993 1001 2 3.0
    insert into(event_low_id, event_id, est_id, amount)
    select event_low_id_s.nextval e.event_id, tg.est_id, tg.amount from
    from TEM_GT tg, EVENT e
    WHERE
    tg.trans_id = e.trans_id
    AND e.flag = 'N'
    Based on TEM_GT and TXN gt, populating data into EVENT table. Now when I try to populate data in the EVENT_LOW table, the above query returns 5 rows instead of 3 rows. This is due to trp_id in TEM_GT table. I do not want to add trp_id in EVENT table, and want to handle the duplicate elimination in the above select query.
    I wrote the below sql. It almost resolve my problem. But sometimes it returns different value for the amount column. I wanted my event_low result as below for the est_id 1.
    event_low_id primary key, event_id, est_id, amount.
    9991 1000 1 1.5
    9992 1000 1 2.0
    But sometime it returns as below
    event_low_id primary key, event_id, est_id, amount.
    9991 1000 1 1.5
    9992 1000 1 1.5
    or
    event_low_id primary key, event_id, est_id, amount.
    9991 1000 1 2.0
    9992 1000 1 2.0
    select *
    from (select x.*,
    row_number() over (partition by event_id order by event_id) rn
    from (seelct e.event_id, tg.est_id, tg.amount
    from TEM_GT tg, EVENT e
    WHERE
    tg.trans_id = e.trans_id
    AND e.flag = 'N'
    ) x
    where rn = 1
    I am using Oracle 11g. Any help. Thanks in advance.

    Hi Suresh,
    Please read SQL and PL/SQL FAQ
    Whenever you create a thread always post sample data as CREATE TABLE and INSERT statements.
    Additionally when you put some code or output please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    Regarding your problem you said:
    Based on TEM_GT and TXN gt, populating data into EVENT table. Now when I try to populate data in the EVENT_LOW table, the above query returns 5 rows instead of 3 rows.
    The above query cannot return 5 rows with the data you have posted. You have 3 rows in TEM_GT and 2 rows in EVENT table. The table are joined ontg.trans_id = e.trans_id AND e.flag = 'N'
    And the result of the query with your posted data is *3 rows*. So try to be clear.
    If your intention is to insert into EVENT_LOW only one row from TEM_GT for the same trans_id then you have to tell us which is the criteria to choose the row between the duplicates (the first by est_id order??).
    Also be careful to post valid statements. The statement below is not valid as it is missing the table name after INSERT INTO and there are 2 consecutive FROM keywords:insert into(event_low_id, event_id, est_id, amount)
    select event_low_id_s.nextval e.event_id, tg.est_id, tg.amount from
    from TEM_GT tg, EVENT e
    WHERE
    tg.trans_id = e.trans_id
    AND e.flag = 'N'
    I will make the assumption that you want to select the first row order by est_id during insertion. If this is not what you want, please change the analytic function:INSERT INTO event_low (event_low_id, event_id, est_id, amount)
    WITH got_data AS
    SELECT e.event_id, tg.est_id, tg.amount
    , ROW_NUMBER() OVER(PARTITION BY tg.trans_id ORDER BY tg.est_id) AS rn
    FROM tem_gt tg, event e
    WHERE tg.trans_id = e.trans_id
    AND e.flag = 'N'
    SELECT event_low_id_s.NEXTVAL
    , event_id, est_id, amount
    FROM got_data
    WHERE rn = 1;
    If this is not what you want please post CREATE TABLE and INSERT statement, and post your expected output (for insertion into EVENT_LOW table) for the data you have posted.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Bug Noticed in the viewcontroller of Version 3.2.20.09

    I noticed a bug in the view/controller of the SQL developer application it is a small one i assume really easy to fix in the next release.
    Here's how to duplicate the bug. create a table with a foreign key.
    After you have created the table right click and select edit.
    Now while in the table edit window (advanced) click the foreign key control in the left column.
    You will see your associations of your foreign key when you first click on it.
    Now select another menu option lets say go back to columns.
    Now select foreign keys menu option again.
    Now this time notice that your associations for your foreign key are missing.
    I am running
    Java(TM) Platform     1.6.0_35
    Oracle IDE     3.2.20.09.87
    Versioning Support     3.2.20.09.87
    Windows 7
    Can anyone else duplicate this possible bug for me and post your results?
    Please do not forget; to post your platform and version information.
    Edited by: JDeCarlo on Feb 14, 2013 8:04 AM

    Hi J,
    I can confirm the behavior you report in 3.2.20.09.87.
    A quick check of the release currently under development shows that the object editor UI has been reworked. The left column now offers only one item for constraints ( Constraints ). Select it and a table appears on the upper right listing constraints by type. Clicking a foreign key constraint causes the constraint details, including associations, to appear on the lower right. All details are preserved when switching between the object attribute types listed in the left column.
    Regards,
    Gary
    SQL Developer Team

  • Solution to detect and discard duplicate JMS messages

    Hi All,
              I have a scenario where in I require this scenario:
              Even though JMS messages are sent twice OR multiple times from JMS producer,as for as consumers are concerned,the JMS consumer should be able to detect and discard the message.
              Can somebody tell me how to achive the same?
              Thanks,
              Prashanth Bhat.

    Funny - I was just talking to our product manager about exposing a "duplicate-elimination" feature in a future release. Anyhow, I think there are two solutions:
              (1) Use transactions on the producer side to guarantee it sends exactly-once. (Eg. The client uses the same tx to get its src message as it does to produce the messaage.) This is the standard solution - and, with batching, often turns out to be the highest performing solution (by far).
              (2) Modify the consumer to keep a history of received messages so that it can detect and discard duplicates. There's a white-paper on this topic here:
              High Performance Message Processing with BMT Message-Driven Beans and Spring
              http://dev2dev.bea.com/pub/a/2006/01/custom-mdb-processing.htm
              While the article specifically mentions "Spring", "Message-Driven Beans", and "BMT", the general concepts apply to any queuing system.
              Be sure to read through the comments. :)
              Tom

  • Duplicate copies of music

    Hi, I have had a problem with my hard drive crashing and had to reload my music files into Itunes. However, because the new files are in a new location the computer read them as all new files and created duplicates of all the songs (2000+). Is there any way to erase the original files (which no longer work of course) without going through and doing them manually? It is really irritating to have 2 copies of each file in the library.
    Thanks
    Kris

    Have a look at Teridon's iTunes Scripts, Robert has a script in there for dealing with duplicates which might be of some help: Teridon's iTunes for Windows Scripts
    Just note: The duplicate eliminator in Robert's scripts package only works for these two kinds of duplicates:
    1) Multiple copies of the exact same file (e.g. "Song.mp3" and "Song 1.mp3", where "Song 1.mp3" is simply a copy of Song.mp3
    2) Multiple entries in the iTunes Library for the exact same file.
    The script does nothing for duplicates that are the same song, but different files (e.g. encoded by someone else, has different artwork or other tags, etc.)
    There are also some third party programs out there, like "Dupe Eliminator" that might help in more complicated cases. If you do a quick web search I'm sure you'll find more: Dupe Eliminator

  • All my songs are in duplicate...8000 of them!??

    Is there a way to delete them without having to do each one individually??

    Did this duplication happen today or recently on a date you can identify? Right click at the top of any column in your library and from the list choose Date Added. Click at the top of the column and sort it to bring the latest dates to the top. If you did it today all your duplicates should have today's date. Select all the tracks with today's date and delete them.
    Alternatively, have a look at Teridon's iTunes Scripts, Robert has a script in there for dealing with duplicates which might be of some help: Teridon's iTunes for Windows Scripts
    Just note: The duplicate eliminator in Robert's scripts package only works for these two kinds of duplicates:
    1) Multiple copies of the exact same file (e.g. "Song.mp3" and "Song 1.mp3", where "Song 1.mp3" is simply a copy of Song.mp3
    2) Multiple entries in the iTunes Library for the exact same file.
    The script does nothing for duplicates that are the same song, but different files (e.g. encoded by someone else, has different artwork or other tags, etc.)
    There are also some third party programs out there, like "Dupe Eliminator" that might help in more complicated cases. If you do a quick web search I'm sure you'll find more: Dupe Eliminator

  • Deleting duplicates on iTunes

    Help I have two and three of the same song. can i delete using iTunes???

    Yes, you can use iTunes, have a look at this page: iTunes - Finding and removing duplicate items
    Of you have a lot of duplicates you and want something more automated, have a look at Teridon's iTunes Scripts, Robert has a script in there for dealing with duplicates which might be of some help: Teridon's iTunes for Windows Scripts
    Just note: The duplicate eliminator in Robert's scripts package only works for these two kinds of duplicates:
    1) Multiple copies of the exact same file (e.g. "Song.mp3" and "Song 1.mp3", where "Song 1.mp3" is simply a copy of Song.mp3
    2) Multiple entries in the iTunes Library for the exact same file.
    The script does nothing for duplicates that are the same song, but different files (e.g. encoded by someone else, has different artwork or other tags, etc.)
    There are also some third party programs out there, like "Dupe Eliminator" that might help in more complicated cases. If you do a quick web search I'm sure you'll find more: Dupe Eliminator

  • Jawbone Bluetooth / Speakerphone Bug

    I have the Jawbone hooked up to my iPhone. When I answer a call and pick speaker phone, the iPhone initially connects to the speakerphone and then, after a word, jumps the audio selection back to the Jawbone. Can anyone with an iPhone and Jawbone duplicate this bug?

    Actually, I have a similiar bug. My husband and I both have iPhones and JawBone headsets. We both have the following problems:
    1. If the headset and phone are paired, then if I make a call NOT using the headset, the following call (incoming or outgoing) will not be picked up by my jawbone headset -- even though the Bluetooth option says it is paired and when I make/receive that call, I do not get any audio source options. I have to unpair and repair every time this happens -- annoying!
    2. If I want to use the phone and not the ear piece, and I click the audio source as iPhone, it will still send it to my headset. I then have to click the iPhone audio source a second time. This is hard to manage since I'm expecting the call on the iPhone and have it up to my ear (and the screen turns off, of course).
    I hope this gets fixed!!

Maybe you are looking for

  • Display wrong map in the report

    Dear all:                   I designed one report and use DE to be the value of 0region's value. But after I executed the report, I saw the map of US!!!!!!!!!!!!  Could you please tell why? How to do with it? Where can I get the solution. It is very

  • Mvt type 351 updating twice

    Hi Experts, While doing goods issue for STO with mvt type 351 the register is updating twice in receiveing plant. Once for 351 and once for 101 mvt type (GRN against STO). Please suggest. Regards, RB

  • Error: Region could not be found in AK_REGIONS;

    we are doing one customization in which we are calling pageContext.forwardImmediatelyToCurrentPage(params, true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO); from process form request and in process request we are checking the parameter passes from proces

  • Cisco 1142AP Autonomous - Radio interface constantly reset and provides crash file

    Hello All, We have 10 Cisco 1142 Access Points currently configured as Autonomous and I'm experiecing very unusual behavior with the 2.4GHz radio interfaces on each of them. The IOS firmware is 15.2.2JB and they're connected to Cisco 2960 PoE switche

  • Multiple SQL statements from JDBC

    Dear All, We are working on R/3- >XI->JDBC scenario. We have sender as Proxy which sends some data to XI which needs to be Updated in multiple database tables in oracle. We have few Insert,Update and Delete Query to be