Inner Join resulting in many, many duplicates
I ran an Inner Join but it returned many, many duplicates. Any idea why that would occur?
One Answer from a different thread:
Because you may be having improper Join condition what has a One to many or a Many to many relationship between the tables. We do not have the data, and hence cannot comment over it. However, since the original issue is resolved, I suggest you close this thread and ask the question in another thread.
What do I look for to identify an improper join?
Please don't start another discussion for the same issue.
Continue on your existing thread where the answers and advice you've already been given can be seen, so that people don't end up giving the same advice you've already had.
Answers on other thread: Inner Join error
Locking this thread
Similar Messages
-
hi All
how many tables join thu inner join.Hi,
You can join any number of tables as long as join conditions exist between the tables. It is not advisable to use more than 4 tables in join. it results in performance issue.
thanks,
sksingh -
Inner join searches too many entries
Hi experts,
In a user exit following code is used:
DATA : h_rsnum LIKE afko-rsnum,
h_charg LIKE resb-charg,
h_matnr LIKE resb-matnr,
SELECT SINGLE rsnum INTO h_rsnum
FROM afko
WHERE aufnr = x_bncom-aufnr.
IF sy-subrc = 0 .
SELECT resbcharg resbmatnr
INTO (h_charg, h_matnr)
FROM mara INNER JOIN resb
ON maramatnr = resbmatnr
WHERE resb~rsnum = h_rsnum
AND resb~charg NE space
AND maramtart = 'HALB' OR maramtart = 'FERT'.
ENDSELECT.
Goal of the source code is to detemine the reservation number of a process order. From table RESB with key h_rsnum, the material nb and the batch nb of the single material with material type HALB or FERT needs to be selected.
During debugging I found out that this code searches into a very long list of materials before ending up with the correct h_charg and h_matnr.
If the condition resb~rsnum = h_rsnum would be taken into account when creating the inner join, the list would only contain 20 materials maximum.
Can this behaviour be changed and how to do it?
Rgds,
Suzyif this is inside a user exit 1st of all why are you using a select endselect and i dont see you take that in to a table which means your only looking for one record.
about you tell that before the inner join taking the where condition into consideration. I dont think it will be possible sine normally after making the join it should go for the where condition anyway ill try to check on it and see.
sometimes Siegfried might know an answer dont know if he saw this.
Nafran
Edited by: Nafran Shiraz on Jun 4, 2009 12:36 PM -
Inner join is not removing duplicates!!
Table name is customers
CNUM CNAME CITY RATING SNUM
1 2001 Hoffman London 100 1001
2 2002 Giovanni Rome 200 1003
3 2003 Liu San Jose 200 1002
4 2004 Grass Berlin 300 1002
5 2006 Clemens London 100 1001
6 2008 Cisneros San Jose 300 1007
7 2007 Perira Rome 100 1004
Query is
To Find all pairs of customers haveing the same rating
I have tried:
SELECT c.cname,cb.cname FROM customers c INNER JOIN customers cb ON c.rating=cb.rating AND c.cname!=cb.cname
CNAME CNAME
1 Perira Hoffman
2 Clemens Hoffman
3 Liu Giovanni
4 Giovanni Liu
5 Cisneros Grass
6 Perira Clemens
7 Hoffman Clemens
8 Grass Cisneros
9 Clemens Perira
10 Hoffman Perira
Ideally it should till 5 rows but it should not return such rows for an e.g. Hoffman Perira since I got Perira Hoffman already. Your repsonse will be appreciated.
Thanks,
VaibhavHi, Vaibhav,
914683 wrote:
Table name is customers
CNUM CNAME CITY RATING SNUM
1 2001 Hoffman London 100 1001
2 2002 Giovanni Rome 200 1003
3 2003 Liu San Jose 200 1002
4 2004 Grass Berlin 300 1002
5 2006 Clemens London 100 1001
6 2008 Cisneros San Jose 300 1007
7 2007 Perira Rome 100 1004
Query is
To Find all pairs of customers haveing the same rating
I have tried:
SELECT c.cname,cb.cname FROM customers c INNER JOIN customers cb ON c.rating=cb.rating AND c.cname!=cb.cnameMaybe what you want is
SELECT c.cname
, cb.cname
FROM customers c
INNER JOIN customers cb ON c.rating = cb.rating
AND c.cname < cb.cname -- not !=
CNAME CNAME
1 Perira Hoffman
2 Clemens Hoffman
3 Liu Giovanni
4 Giovanni Liu
5 Cisneros Grass
6 Perira Clemens
7 Hoffman Clemens
8 Grass Cisneros
9 Clemens Perira
10 Hoffman PeriraThe title you chose for this thread is "inner join is not removing duplicates!!".
Inner joins (or any other kinds of joins) are not supposed to remove duplicates. Use SELECT DISTINCT to remove duplicates, that is, completely identical rows.
You don't have any duplicates. For example, these rows from your result set:
` CNAME CNAME
1 Perira Hoffman
10 Hoffman Periraare not identical; in fact, both columns are different.
Ideally it should till 5 rows but it should not return such rows for an e.g. Hoffman Perira since I got Perira Hoffman already. Please post the exact output you want from that sample data. (As Hoek said, you should post CREATE TABLE and INSERT statements for the sample data, too.) -
Hi,
We have developed an universe on BI query and developed report on it. But while running this BO query in Web Intelligence we get the following error
A database error occured. The database error text is: Error in MDDataSetBW.GetCellData. MDX result contains too many cells (more than 1 million). (WIS 10901)
This BO query is restricted for one document number.
Now when i check in the BI cube there are not more than 300-400 records for that document number.
If i restrict the BO query for document number, delivery number, material and acknowledged date then the query runs successfully.
Can anyone please help with this issue.follow this article to get the mdx generated by the webi report.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90b02218-d909-2e10-1988-a2ca74547900
then try to execute the same in mdxtest transaction in bw -
Error message: "Warning: unresponsive script". Afterward, the system freezes and will then crash. Crash reports have been submitted many, many times without response. I have tried the fore-mentioned solutions with either no results or very bad results which I filed a report but did not receive an answer. The application to block scripts actually worsened the problem and I could not correct the situation for a while (no response from Firefox, at all). I have also been through this procedure without any one contacting me, AT ALL.
== URL of affected sites ==
http://http://www.facebook.com (always) and www.YouTube.com (sometimes)There does appear to be any support whatsoever from mighty "non caring" FIREFOX & people are getting fed up. We may as well try another system, if they can't be bothered to provide any support for their system, we can't be bothered to use their system.
Brianeng -
MDX result contains too many cells - But relese note applied!!!!!!
Hi experts!
When I create a query with my infoview, it retrive me the following error:
<ERROR COMPONENT="WIS" ERRORCODE="10901" ERRORTYPE="USER" MESSAGE="Si è verificato un errore del database. Il testo dell'errore del database è: Errore in MDDataSetBW.GetCellData. MDX result contains too many cells (more than 1 million). (WIS 10901)" PREFIX="ERR">
I try to understand if there are some problems about the sap.notes. In particular I ask to the technical people if the following note had installed into my system:
Note 931479 - MDX: More than 1,000,000 instances per axis
The technical people said me that this note had been installed because the system is to level 23.
bold
Then what problem may be due the fact that my mdx is not able to contains more than 1 million of cell ?
bold
thank'you in advance !Hi,
whats the release of the SAP BW System - including patch level ?
whats the release of the SAP BusinessObjects system including patch level ?
Ingo -
Error - DRG-51030: wildcard query expansion resulted in too many terms
Hi All,
My searches against a 100 million company names table on org names often result in the following error:
DRG-51030: wildcard query expansion resulted in too many terms
A sample query would be:
select v.* --xref.external_ref_party_id,v.*
from xxx_org_search_x_v vwhere 1 =1
and state_province = 'PA'
and country = 'US'
and city = 'BRYN MAWR'
and catsearch(org_name,'BRYN MAWR AUTO*','CITY=''BRYN MAWR''' ) > 0
I understand that is caused by the presence of the word Auto to which we append a * . (If i remove the auto the search works fine).
My question is - is there a way to limit the query expansion to only , say 100, results that get returned from the index?Thanks for the reply. This is how the preferences are set:
exec ctx_ddl.create_preference('STEM_FUZZY_PREF', 'BASIC_WORDLIST');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','FUZZY_MATCH','AUTO');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','FUZZY_SCORE','60');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','FUZZY_NUMRESULTS','100');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','STEMMER','AUTO');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF', 'wildcard_maxterms',15000) ;
exec ctx_ddl.create_preference('LEXTER_PREF', 'BASIC_LEXER');
exec ctx_ddl.set_attribute('LEXTER_PREF','index_stems', 'ENGLISH');
exec ctx_ddl.set_attribute('LEXTER_PREF','skipjoins',',''."+-/&');
exec ctx_ddl.create_preference('xxx_EXT_REF_SEARCH_CTX_PREF', 'BASIC_STORAGE');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'I_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'K_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'N_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'I_INDEX_CLAUSE','tablespace ICV_TS_CTX_IDX Compress 2');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'P_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX ');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'I_ROWID_INDEX_CLAUSE','tablespace ICV_TS_CTX_IDX ');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'R_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX LOB(DATA) STORE AS (CACHE) ');
exec ctx_ddl.create_index_set('xxx_m_iset');
exec ctx_ddl.add_index('xxx_m_iset','city, country');
exec ctx_ddl.add_index('xxx_m_iset','postal_code, country');
Users will always use city or postal code when searching for a name. When I run this query -
SELECT dr$token
FROM DR$XXX_EXT_REF_SEARCH_CTX_I1$I
where dr$token like 'AUTO%'
ORDER BY dr$token desc
i get more than 1M rows.
is there a way to include and search for the city name along with the org name?
Thanks again.. -
hi all,
i m using inner join for 3 tables but problem is that i m getting repeated values while table contains only
2 record but inner joi shows me 4.
codes : SELECT m1pernr m2lgart m2endda m2betrg m2zuord m3lga01 m3bet01 m3begda INTO TABLE itab
FROM pa0000 AS m1 INNER JOIN pa0015 AS m2 ON m1pernr = m2pernr
INNER JOIN pa0589 AS m3 ON m1pernr = m3pernr
WHERE m1pernr IN pernr AND m1endda = '99991231' AND m1~stat2 = '3'
AND m2~lgart = '4004'
AND m3~lga01 = '4004'.
getting values in itab like :
PERNR LGART BETRG BET01
8430 4004 5834.00 5004.00
8430 4004 8748.00 5004.00
8430 4004 5834.00 1000.00
8430 4004 8748.00 1000.00
while it must be like this :
PERNR LGART BETRG BET01
8430 4004 5834.00 5004.00
8430 4004 8748.00 1000.00
can anyone please help me.
regards saurabh.Hello Saurabh,
Include all the primary key fields in the where clause for PA0015 and PA0589, while comparing with those in PA0000. Since the key fields for all these '3' tables are same this should not be a problem.
If you have any reservations about changing the select query, then, sort your final internal table with a defined sort key (based on your requirement) and use "Delete adjacent duplicates" with the same sort key.
Please let me know if this helps.
Regards,
Pavan -
MDX result contains too many cells - NUMC 6
Hi to all.
I'm using I bex query in order to retrieve the field to my universe.
I know that when there is an element defined as NUMC (6), some errors may occurs into the MDX extraction (e.g. MDX result contains too many cells (more than 1 million)).
Can I set everythink in my BEX query or in my universe definition in order to not change the caratcteristic in my SAP BW system ?
Indeed I will have some bureaucratic and formal problem to change the sap bw type definition of the caracteristics.
Thank'you in advance.hi Ingo,
Are you sure ? Indeed when I try to run a query where I have a NUMC6 filed and another field there is the error attached above.
Instead when I run the same query without the NUMC6 field the query ends correctly.
Moreover I see in the "SAP Note 1378064" where I see in the "Reason and Prerequisites": The internal data types are incorrect due to NUMC(6). The conversion to integer is required.
But I don't know if this conversion is allowed in the Bex Query step or in the universe filed definition.
Any advice will be accepted ! -
Many many many contact duplicates
I've had a severe problem with Apple creating many, many duplicates (734 to be exact) of a single contact on my iPhone. Other people are having this problem as well. Although my computer Address Book only listed the contact once, my iPhone had a ridiculous amount. iCloud syncing didn't work, iTunes synicing didn't work. My husband was able to fix this problem and here's what he did.
BEFORE you do anything though, make sure all your contacts are on the computer in your Address Book or else they'll all get erased.
On your iPhone & your Apple computer uncheck the "Sync with iCloud" for contacts only (selecting the "remove/delete from phone" when it asks what you want to do after un-syncing).
Go into your computer address book and delete the one(s) that's repeating.
Use a web browser and log into iCloud and delete all the repeating ones (delete every one of the duplicates, don't even leave one of them or it will start creating many, many multiples).
Wait a moment and make sure the contacts don't magically start reappearing again (if they do, then good luck!)
Check and make sure you have no synced contacts on your phone.
Go back to both your phone and your computer and resync with iCloud (now the contacts you saved on your computer will go onto your phone).
Then you *should* be able to add the one contact that was the crazy repeater.
I hope this works for any of you that have had this problem, and hopefully your contacts don't get erased either! Good luck!If you are syncing contacts with iCloud you should not be trying to sync contacts with iTunes too, if that's what you're doing. This may help you resolve your problem with duplicates: http://support.apple.com/kb/TS4147.
-
DRG-51030: wildcard query expansion resulted in too many terms
Hello,
I have sql report in my apex application that is based on sql query with oracle text. I am trying to execute query with % parameter: select * from mytable where contains(term, '%')>0
I now that wildcard_maxterms default maximum is 5000 and in sql-developer query works normally without any errors, but in apex I receive DRG-51030: wildcard query expansion resulted in too many terms.
Please help!!!Hello,
There's a good discussion of that exception here -
How to limit the number of search results returned by oracle text
John
http://jes.blogs.shellprompt.net
http://apex-evangelists.com -
Inner Join within results?
So if an item is a bottle, it will have a unique BottleKey and Null for CaseKey and if
an item is a Case, it will have a unique CaseKey and Null for BottleKey. However, the PrimaryIDs are the same for both the bottle and case. I get the results to look like this:
Bottlekey CaseKey PrimaryID
4754 NULL ABC-234
NULL 5465 ABC-234
Is there a way to get the result sorted by Primary ID?
So that the rows are halved from what we have in the table above and the results look like
PrimaryID CaseKey BottleKey
ABC-234 5465 4754
Thanksselect distinct a.PrimaryId,c.CaseKey,b.BottelKey from test a
inner join
(select distinct PrimaryId, BottelKey from test where BottelKey is not null) b
on a.PrimaryId=b.PrimaryId
inner join
(select distinct PrimaryId,CaseKey from test where CaseKey is not null) c
on a.PrimaryId=c.PrimaryId
Replace test table with your orignal table -
Inner Join and "PIVOT" results
Good day all;
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
"CORE 10.2.0.4.0 Production"
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
I have 2 tables that I would like to do a query on and then "pivot" the results. I understand that since this is 10g that the use of PIVOT is not supported.
(Corrected code issues :))
create table CT
DESIGN_ID NUMBER,
CT_ID VARCHAR2(15)
INSERT INTO CT VALUES ('654321','10QWER123456');
INSERT INTO CT VALUES ('987654','7ASDF654987');
INSERT INTO CT VALUES ('321654','82CHEV852963');
create table CXRF
DESIGN_ID NUMBER,
ROW_SEQ_NBR NUMBER,
XREF_CT_ID VARCHAR2(15)
INSERT INTO CXRF VALUES ('654321','1','25ABCD');
INSERT INTO CXRF VALUES ('654321','2','262ABCD');
INSERT INTO CXRF VALUES ('987654','1','14WXYZ');
INSERT INTO CXRF VALUES ('987654','2','34FRED');
INSERT INTO CXRF VALUES ('321654','1','1TOM');- Oops measure twice cut once..
select design_id,
ct_id,
xref_ct_id
from cxrf
INNER JOIN
ct
on(ct.design_id = cxrf.design_id) Desired results would look like this:
DESIGN_ID CT_ID XREF_CT_1 XREF_CT_2
654321 10QWER123456 25ABCD 262ABCDEdited by: GMoney on May 9, 2013 8:47 AM
Edited by: GMoney on May 9, 2013 8:49 AMPlease provide WORKING sql:
SQL> create table CT
2 (
3 DESIGN_ID NUMBER not null,
4 CT_ID VARCHAR2(2)
5 );
Table created.
SQL> INSERT INTO CT VALUES ('654321'','10QWER123456');
ERROR:
ORA-01756: quoted string not properly terminated
SQL> INSERT INTO CT VALUES ('987654','7ASDF654987');
INSERT INTO CT VALUES ('987654','7ASDF654987')
ERROR at line 1:
ORA-12899: value too large for column "SCOTT"."CT"."CT_ID" (actual: 11, maximum: 2)
SQL> INSERT INTO CT VALUES ('321654','82CHEV852963');
INSERT INTO CT VALUES ('321654','82CHEV852963')
ERROR at line 1:
ORA-12899: value too large for column "SCOTT"."CT"."CT_ID" (actual: 12, maximum: 2)
SQL>
SQL> create table CXRF
2 (
3 DESIGN_ID NUMBER
4 ROW_SEQ_NBR NUMBER
5 XREF_CT_ID VARCHAR2(12)
6 );
ROW_SEQ_NBR NUMBER
ERROR at line 4:
ORA-00907: missing right parenthesis
SQL> INSERT INTO CXRF VALUES ('654321','1','25ABCD');
INSERT INTO CXRF VALUES ('654321','1','25ABCD')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('654321','2','262ABCD');
INSERT INTO CXRF VALUES ('654321','2','262ABCD')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('987654','1','14WXYZ');
INSERT INTO CXRF VALUES ('987654','1','14WXYZ')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('987654','2','34FRED');
INSERT INTO CXRF VALUES ('987654','2','34FRED')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('321654','1','1TOM');
INSERT INTO CXRF VALUES ('321654','1','1TOM')
ERROR at line 1:
ORA-00942: table or view does not exist:p -
"This webpage has a redirect loop" "....resulted in too many redirects"
Hi, I am trying to connect to a cloud account for the first time.
BUT I get this error here...
This webpage has a redirect loop
The webpage at https://database-xxxxxx.db.us1.oraclecloudapps.com/apex/f?p=4500:1000:118209995883759 has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
Here are some suggestions:
Reload this webpage later.
Learn more about this problem.
Any help appreciated,
BillFound the problem!
Oracle - need to capture that error and make more descriptive.
maybe - "User does not have the proper role to view this page"
I went into the
Identity Management Console: https://idmconsole.us1.cloud.oracle.com/identity/faces/pages/Identity.jspx
for my Domain.
"Manage Roles" - hit search (because the roles don't show if you don't hit the search button)
and then Assigned the "Database Developer" and "Database Administrator" roles to the users that were getting the error.
Maybe you are looking for
-
How to embed views dynamically in a view container ?
Hi , Can you please guide me how to embed a view dynamically in a view container ? Thanks & Regards Gaurav Jain
-
The old "backup disk cannot be found" conundrum
i've seen this message a few times before but the resolution has always been as simple as checking the connection. but not this time. time machine is not seeing the external drive at all. it shows up in disk utility and these are the messages i recei
-
Flash player still not working after following all discussion advice
Requested information: I have Internet explorer 9/ using 32 bit on 64 bit computer/windows 7/flash player 10.2 version I contracted what my husband called a "rider" virus when I opened a knitting pattern of all things and if I understood it correctl
-
Are .png icon files supported in forms? Regards Gerton ten Ham
-
Is there any way I can monitor how many Gb I download each month?
I'm considering changing broadband package and would like to know how much I download each month. All I can find are ways of estimating based on size of various files, streaming etc. as a multi person household it would be much more useful to know ex