Selecting/Pulling Duplicates in JOIN? Why happening?

Hi Experts,
One simple doubt is that,
Am pulling the records from 2 tables i.e. MBEW and MAKT for the selection criteria, by doing JOIN on MATNR..........But, the duplicates r coming! I mean, if the MATNR_1 is existing 1000 plant, its repeating 3-4 times!!
Any clue?
thanq.
Message was edited by:
        Srikhar

hi Srikhar,
you did not copy you SELECT statement...
One possible cause is that in the WHERE you are restricting on matkt-spras. In MBEW there are alos more records for one MATNR, so please copy your whole SELECT here to be able to help you out.
ec

Similar Messages

  • Query to pull duplicates in last 15 days

    I have a table with Account and Trans_date columns. I am trying to write a query to pull the accounts that are present today and also present in the last 15 days.
    [SQL]
    select distinct  a.*
    from
        select
                SFD.ACCOUNT,
                SFD.TRANS_DATE
        FROM CIRC_RPT.VW_SUBS_FINANCIAL_DRW SFD
        WHERE  SFD.trans_date between trunc(:Enter_date) -15 and trunc(:Enter_date)
        ) a
        join
        select
                SFD.ACCOUNT,
                SFD.TRANS_DATE
                FROM CIRC_RPT.VW_SUBS_FINANCIAL_DRW SFD
        WHERE SFD.trans_date = trunc(:Enter_date)
        )b on a.account =b.account
        order by a.account
    [\SQL]
    This query is pulling the duplicates but it is also pulling accounts that are only present on :Enter_date(not present in the past 15 days).
    Please advice on the logic. Thanks in advance for your help.

    Hi,
    I think you want something like this:
    SELECT  *
    FROM    circ_rpt.vw_subs_financial_drw p15
    WHERE   trans_date  >= TRUNC (SYSDATE) - 15
    AND     trans_date  <  TRUNC (SYSDATE)
    AND     EXISTS (
                       SELECT  1
                       FROM    circ_rpt.vw_subs_financial_drw
                       WHERE   account = p15.account
                       AND    trans_date = TRUNC (SYSDATE)
    You can use :Enter_date instead of SYSDATE, but make sure it really is a DATE.  If :enter_date is a string, then remember to use TO_DATE.
    If you do a join, you'll get duplicate rows if there happen to be 2 (or more) rows for the same account dated today.
    The main problem with what you posted was that the way you checked for the past 15 days:
    WHERE  SFD.trans_date between trunc(:Enter_date) -15 and trunc(:Enter_date)
    Any row that met the condition for occurring on :enter_date
    WHERE SFD.trans_date = trunc(:Enter_date)
    would also meet the other condition, since BETWEEN includes both end-points.

  • Why am I sometimes sending duplicate emails and why when I sometimes single click an incoming messages to view it in the viewer window  why does it open?

    My computer got very touchy a few days ago as in the finder or in mail I would single click to select an item and it would open (rather than alloiwng me to just select it) or I would command select to select several items and they would open before I finished.
    I did a complete reinstall and finder part of the problem is gone, but it still exists in Mail.  Also before the reinstall just about every email I sent would duplicate-- not it only happens occaisionally.
    Anyone got any ideas-- thank you

    Hi, ybg, and welcome to the Community,
    Your detailed report (thank you) indicates to me your account has been compromised a second time.  Change your Skype account password immediately if you have not already done so, as well as that of any saved payment method on file.  I would also run a maintenance cycle on your computer/laptop, ensuring all patches and updates are installed.  Also run your preferred anti-virus/malware/spyware suite using the most recent virus signature files available.
    You are right to contact Skype Customer Service to report this incident.  I have read that people experience problems reaching them, however please do continue to do so, choosing a different path through the various steps than you used the first time; try also using a different web browser.  I have also read that the instant message chat sessions with Customer Service agents appear as a pop-up dialogue box, which needs to be enabled or the connection to the agent will not process.
    Here is a link to the instruction on how to contact Skype Customer Service via their secure portal: Contact Customer Service
    As a general proactive precaution, I would recommend reviewing how you access the internet, particularly seeking any vulnerabilities or patterns common to the first incident and this one.
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Cannot select ROWID from a join view without a key-preserved table at OCI c

    Hi All,
    Can anybody help me..?
    When i am creating the request in the presentation services ..
    for some of the columns i am getting the following error..by removing those those columns it's working fine..
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1445, message: ORA-01445: cannot select ROWID from a join view without a key-preserved table at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
    Please suggest me a solution..
    Thanks in Advance...

    Looks like you have a view that contains the ROWID of another table. Does the view work first from sqlplus? See whether it returns any data. Its a ORA- specific error. So, the error is related to your view rather than BI EE. Also, how many columns are you trying to pull in your report?
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Why DDL during SELECT is possible. Or why SELECT does not put a table lock?

    This is a question to people who really knows Oracle internals or/and RDB theory.
    (The question is relocated from another thread for not hijacking on that's original question.)
    Why DDL during SELECT is possible? Or why SELECT does not put TM 2 Row Shared lock on table(s)?
    This not locking causes a possibility while one session is running a long select, another can truncate and even drop table(s) that are being read by the first session.
    I think, humbly assume, that Oracle does not put TM 2 lock on tables, that are being simply SELECTed, by some significant technical reason. But I do not know this reason. If somebody knows please shed a light.
    Also, if you know that this behavior is totally correct from perspective of RDB theory, please explain me.
    I'll try to explain my point.
    It is a matter of data consistency and integrity that is supported in Oracle everywhere except this place.
    a) If one session is reading data from moment T and other session changes data on its way at moment T1, the first session wont read that changed data, it will read the data that was there on moment T.
    This is declared as Read Consistency principle.
    b) If one session is changing data, and another session tries to truncate or drop table - the second session will fail with error ORA-00054: resource busy and acquire with NOWAIT specified.
    This is declared as Data Integrity principle.
    c) But why not to follow the above principles in case when one session reads data and another session tries to truncate or drop table (or do other DDL operations)?
    It is counter-intuitive. Why not to put TM 2 (SS) lock during SELECT execution that would prevent DDLs on this table?
    What I only can assume is that this is only because some technical difficulty or limitation.
    What is this limitation or other reason in favor of which Oracle sacrificed consistency in this case?

    user11181920 wrote:
    Aman,
    There was no need to clarify how DML lock works, I know that.
    Also I know that in Oracle a Select does not lock neither table rows nor table itself.
    The reason I mentioned it because you brought up the word change which is far better suited for DML's than DDL's as the former has a requirement to have its Undo preserved.
    Again, my question was why Select does not protect itself by locking table(s), partitions and indexes?Protect from what? There is nothing wrong with doing a select. What would happen with a select doing a lock on the table before being executed in its entirety (forget DDL and DML altogether for a moment) ? State one good reason that there should be a lock for the select. If it has to, it would be always isn't it?
    The keyword here is concurrency and that's what is the best when the number of locks obtained are lesser at non-required operations. A select doesn't change anything that's why in Oracle, there is no read-level lock.I am not saying about row locks while reading. They are not needed because Undo resolves concurrency.Only in the case of DML where the change is still active and the buffers are dirty. With a DDL, its an implicit commit.
    I am asking why Select does not enqueue one, only one lock per object that participates in the Select?Again, my question back to you is, what good you would get from it? What purpose it would solve?
    It is not very expensive, I suppose. But it would protect from DDLs that can destroy the Select's result set. You have seen in your system and in my demo(and that's what the the question was on the other thread also) that the result remains intact and its not a behavior from now. Its the same since the time I have started learning Oracle. Can you explain that why you think that the result of select statement would be wrong for a drop table? I believe, its been stated repeatedly that if the select has no requirement to look back the table, it would get completed. Only if the select needs to access the table again, it would fail. So even if we consider your explanation, there is no wrong result shown at all. Once the session encounters that the table is dropped for the statement, the execution stops right away. So where is the destroyed result?
    Yes, it is less dangerous when Select does not lock table comparing with what would happen with DMLs in such case (that is why DMLs protect themselves by TM 3), it affects only the Select and its consumer, but still ... I don't understand this Oracle's decision. What is a reasoning behind it?.As I said, to improve concurrency.
    Aman....

  • After download and installation of PS PE12 I have problems starting the programm. After selecting video and new project nothing happens, only the colorbar below new project is showing

    New computer.
    After download and installation of PS PE12
    I have problems starting the programm, double clicking on the icon.
    After selecting video and new project nothing happens, only the colorbar below new project is showing, nothing happens.
    (expected was to activate the program and the sarting the PE12)
    PSE12 runs fine
    System:
    WIN8.1 / i7 /16GB RAM

    New computer.
    After download and installation of PS PE12
    I have problems starting the programm, double clicking on the icon.
    After selecting video and new project nothing happens, only the colorbar below new project is showing, nothing happens.
    (expected was to activate the program and the sarting the PE12)
    PSE12 runs fine
    System:
    WIN8.1 / i7 /16GB RAM

  • I have set up my airprint wifi printer which works perfectly with the HP eprint app. However, when i view an email and click on the top right arrow button and select "PRINT" on my ipad nothing happens????...

    I have set up my airprint wifi printer which works perfectly with the HP eprint app. However, when i view an email and click on the top right arrow button and select "PRINT" on my ipad nothing happens????...
    Also, when im viewing websites and i find something i wish to print, same again, if i simply click on the print option at the top right of the screen nothing happens... the only way I can print is if i copy the weblink of the site page then click on my HP eprint app and paste the web link, then select print, it prints off fine.. but its it such a pain to keep copying and pasting links or screen dumping emails just to print...

    Just to recap, this is a collection of ports I have collected over time for people who needed this information when setting up the HP ePrint app so that they could view their email from within the app.  I am certain other applications also need this information.  Although lengthy, I could not find a more comprehensive place to retrieve this information.  Feel free to post additional information, faulty information, or other related topics below as this is simply a collection of data and it would be practically impossible to test all of them. Thank you!
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • My phone is no wifi. I can not select the button. this situation has happened to me several times and I have spent lots of money on repairs. what can I do?

    my phone is no wifi. I can not select the button. this situation has happened to me several times and I have spent lots of money on repairs. what can I do?

    Bring your phone to Apple for evaluation and replacement.  It's broken.  There's no magic we can provide you.

  • Absolute dynamic select query with dynamic join and where

    Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions.
    I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors.
    Please let me know where am I going wrong OR is it really possible to create such a dynamic Query??
        SELECT (FIELDS) INTO TABLE IT_TABLES
          FROM ( (ME->TABLE1)  inner join ( me->table2 )
          on ( on_condition ) )
          WHERE (me->where_fields).
    Ags.

    It worked for me in a following way:
    select * into corresponding fields of table <result_table>
            from (join_string)
            where (l_where).
    Where the contents of join_string were dynamically build using concatenation. So it will be something like
    concatenate ME->TABLE1 'as a INNER JOIN' me->table2 'as b ON (' into join_string separated by space.
    <...>
    add here matching/reference colums, something like
    concatenate 'a~' me->TABLE1_JOIN_COL into temp1.
    concatenate 'b~' me->TABLE2_JOIN_COL into temp2.
    concatenate join_string temp1 '=' temp2 into join_string separated by space.
    <...>
    concatenate join_string ')' into join_string separated by space.
    And then use similar approach for l_where variable.

  • SELECT Query design with JOINS

    Dear Users,
    In one of our requirements, we have a SELECT query which joins a few tables together and selects a few fields from each table.
    Example: Fields 1,2 and 3 from Table 1
             Fields 4 and 5 from Table 2.
    These fields are later displayed in the form of an ALV. However, the end user wants more fields on the output, let's say field 6 from Table 2. Due to this requirement, I have to amend the SELECT query to add field 6 of Table 2.
    The above example is simple since it only involves 2 tables. However, in reality, we have a SELECT query with INNER JOINS on more than 6 tables and we don't want to change the code when someone asks for an additional field from one of these tables. Is there any way by which I can design my SELECT query (Using field symbols or dynamic selections etc) such that I don't have to amend the SELECT query and instead I should be able to maintain the field required by the user and it's source table name in a Z-Table and the SELECT automatically picks it up ? Thanks!
    Vijay

    better you can create a view on your 6 or more tables and select the fields .
    Use Select *  from <view name> every time in a select statement.
    If you need a additional column then just change the view , there is no need to change of your select query.
    with regards
    Edited by: Avenai on Jun 28, 2010 2:09 PM

  • HT4641 Im trying to print off my cv, page 1 prints off fine but page 2 does not, I'm using the selected template for curriculum vitae why does my page 2 not print?

    Im trying to print off my cv, page 1 prints off fine but page 2 does not, I'm using the selected template for curriculum vitae why does my page 2 not print?

    Hi @kots 
    I suspect your question would be better answered in the HP Enterprise Business Community, as your HP Printer is a commercial model.
    My technical expertise is with consumer products and software, I am sure the commercial folks would be happy to help if you re-post your question for them to answer. The HP Enterprise Business Community is an HP Forum designed for the Commercial and Enterprise customers to help one another. I am sure you will find some HP folks there to help too.
    Click here to view the Printing and Digital Imaging. When the page opens you will see the option to 'Log in' or 'Register Now' on the right. The commercial forums are separate from the consumer boards, thus you will need to register if you don't already have a commercial account.
    You may find the HP LaserJet M2727 Multifunction Printer series page helpful while you wait for somebody in the commercial Forum to respond to your inquiry.
    Best of luck.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • When I right click on an entry in the bookmarks and select Open in Internet Explorer, nothing happens.

    When I right click on an entry in the bookmarks and select Open in Internet Explorer, nothing happens. It does work when I am on a page , right click and select View this page in IE.

    If you right-click the image and choose View Image Info, what shows as "Type"?
    If it shows JPEG image, for example, make sure to save the file with a .jpg file extension. If you place quotation marks around the entire file name, e.g.,
    "myfile.jpg"
    then you can ensure that the name as the correct extension. Does that help?

  • ORA-01445 : cannot select rowid from a join view without a key preserved ta

    Hi,
    I am using Designer6i for generatin forms:
    my blokc is based on a view...
    when executing the module, I have the following error when trying to change a value of an item :
    FRM 40501: unabe to reserve record for update or delete ,
    the display error say :
    ORA-01445 : cannot select rowid from a join view without a key preserved table!!!!!
    Any help please ???

    you either create an INSTEAD OF trigger for that view or use on-lock trigger on that block to edit, e.g., SELECT ...INTO...FROM...WHERE...FOR UPDATE NOWAIT.

  • ORA-01445: cannot select ROWID from a join view without a key-preserved tab

    Hi All,
    I have 2 windows in a form. When i click on a button in first window, then 2nd window will be opened. (Note: both windows are based have master-details relationship with Table1 and Table2 respectively)
    When i enter the information in 2nd window and click the SAVE Button it has to save those values to database. It used to work fine earlier. now, i am getting the following error.
    FRM-40501: ORACLE error: unable to reserve record for update or delete.
    ORA-01445: cannot select ROWID from a join view without a key-preserved table
    Please help me, how can i resolve this error. Also, guide me what is a key-preserved table.
    Thanks in advance,
    Amar

    Firstly: - Please make sure that you have not opened the same record somewhere else in any other form and trying to update from there.
    Secondly: - In your window 1 have you opened the same record which you are querying, editing and saving in window 2 ? If yes then this will givbe you error as you are trying to update a record which is already being updated somewhere else.
    Please mark if it helps

  • Select statement from a join file deletes the primary records with MS Expl.

    Hello,
    is reality,
    Select statement from a join file deletes the primary records with MS Explorer 6, Firefox not, this with a normal data provider or with a normal "select..." statement.
    This is very strange, I should have a.a.s.p. a solution or workaround
    Thanks, Franco.
    Message was edited by:
    fbiaggi

    Please see the following excerpt from the online documentation.
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_modes.htm#SUTIL1332
    Enabled Constraints
    During a direct path load, the constraints that remain enabled are as follows:
    NOT NULL
    UNIQUE
    PRIMARY KEY (unique-constraints on not-null columns)
    NOT NULL constraints are checked at column array build time. Any row that violates the NOT NULL constraint is rejected.
    Even though UNIQUE constraints remain enabled during direct path loads, any rows that violate those constraints are loaded anyway (this is different than in conventional path in which such rows would be rejected). When indexes are rebuilt at the end of the direct path load, UNIQUE constraints are verified and if a violation is detected, then the index will be left in an Index Unusable state. See "Indexes Left in an Unusable State".

Maybe you are looking for

  • Crystal Report Dll problem with Visual Studio 2005

    I am using Crystal Reports with Visual Studio 2005. At one time there were two different version of Crystal Decision Dll in Global Assembly Cache (GAC). So I uninstalled both the versions and then only installed 10.2.3600. I am facing the following e

  • Report for all Collection Resources all Memberships

    Hi All, Hope you are all doing very well, I have one situation where I need to know all the memberships of a specific collection resources. We have a collection ABC and have about 800 computers in this collection. I have to provide a report to my Man

  • DNS, site question

    I am tinkering with Snow Leopard Server as a web/file/vpn server. I am not able to get it working however, and wondered if someone could help me out. I am a noob to mac as a web server, but have some experience in dns and apache hosting in the tradit

  • Can't open safari help viewer

    When I try to find something about safari in help viewer and everything is blank. I look in library and it has no help viewer for safari. Can I down;load it somewhere? or I need to reinstall safari? I'm not good at computer, so I don't know what disk

  • Use analog input as sample clock

    Hi,     I have a PCI 6115 DAQ card. I currently perform an analog acquisition on ai0, with an external clock on PFI7. But sometimes, my clock signal is not high enough and the acquisition does not occur. At some NI show, I heard a trick to solve this