Home » RDBMS Server » Server Administration » How to avoid replication of rows while making the joins between two tables?
How to avoid replication of rows while making the joins between two tables? [message #374947] Thu, 12 July 2001 23:21 Go to next message
Gurusubramanyam
Messages: 79
Registered: July 2001
Member
Pls anybody help.
i have two transaction tables. when i am trying to join these two tables it is replication is occoured i.e
cartsn. product. how to avoid that?

--prasad
Re: How to avoid replication of rows while making the joins between two tables? [message #374948 is a reply to message #374947] Fri, 13 July 2001 04:01 Go to previous messageGo to next message
murarishettysrinivas
Messages: 9
Registered: July 2001
Junior Member
Prasad

use some join condition.

U r question is not clear.if it is more clear

may be i can of some help

regards
ms
Re: How to avoid replication of rows while making the joins between two tables? [message #374949 is a reply to message #374947] Fri, 13 July 2001 07:15 Go to previous message
Cindy
Messages: 88
Registered: November 1999
Member
Ways to avoid cartesian product is to use subquery or include valid join conditions.

Example subquery:

SELECT column1, column2, column3, column4
FROM table_name1 t1
WHERE (t1.column2, t1.column3) IN (SELECT t2.column2, t2.column3 FROM table_name2 t2
WHERE t1.column1 = t2.column2
AND column1 = 605;)
AND MIN(t1.column4) > (SELECT MIN(t2.column4) FROM table_name2 t2 WHERE t1.column1 = t2.column2 AND t2.column1 = 605;)
AND t1.column1 <> 605;
Previous Topic: Neg. logic in SQL
Next Topic: GROUP BY & ROWNUM
Goto Forum:
  


Current Time: Mon Dec 23 19:46:53 CST 2024