Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Tricky SQL
"Randi Wølner" wrote:
> I have a quesetion about joining tables:
>
> I have one starting table, and then I am going "through" 3-4 other tables by
> joining columns to the table that I am actually looking for some results in.
> But - as the model is now, there are four different "ways" to get to the
> result table, and these four do not include exactly the same tables.
>
> Is there any smart way to avoid join with one specific table, in the cases
> where there should be no link to it?
> (if so - I could probably solve this by using one query and have different
> OR-parts in the WHERE-clause)
>
> Otherwise I guess I will have to use all four queries, with UNION between
> them..
>
> Thanks,
> Randi Wølner
My impression from what you wrote is that you haven't a clue about how to join tables. This may not be true but it is the impression you have given to this reader. Having "one starting table" makes no sense in an of itself. I think you will need to post table structures and code examples for anyone to be able to help you.
A query should contain only those tables necessary to create the answer set. If you are linking in extraneous tables either stop doing it or seriously consider the fact that your schema is not properly designed.
Daniel A. Morgan Received on Mon Jun 18 2001 - 16:36:55 CDT