Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a Join

Status
Not open for further replies.

sbloomfi

MIS
Jul 12, 2002
2
US
I have 2 Oracle 8i tables with about 15 columns each. I want to join these tables, but there is no relationship.
Can I just join the tables on like columns?
 
Do your "like" columns have data values that match and represent the same things? You can join a table with a "State" column with one with a "ST" column if they both have values like "AL", "AK", etc.

I'm not sure if you're asking a SQL question or a theoretical question.
 
I have a decode statement that makes the table's columns have matching values. The problem is, I have 2 queries that run in about 30 seconds each. However, when I join the tables and create a single SQL statement the query takes over 10 minutes before I cancel it! Could a non- primary key / foreign key join make the query take so much longer, or is the join creating some sort of cartesian product?

Thanks,
-SB
 
Why don't you just make everyones life easier and post the schema of the tables and your code?

It sure sounds like you created a cartesian join but since you have never posted what you are actually doing how do you expect anyone to be able to tell?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top