Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Tricky SQL
In modern syntax, you are trying to do a 'left join', in the old terms, an outer join.
Basically, set up a view (or SQL statement) that configures all 6 tables (the base and 4-5 others) as if all were used.
My guess is that your statement will look something like: select * from a left join b on a.key=b.key left join c on c.key2=a.key2 left join d on d.key2=a.key3.
(it probably won't be that neat.)
It is doable, but with 6 tables, be sure to get what you want from the joins, instead of what you tell SQL to give you.
"Howard J. Rogers" <howardjr_at_www.com> wrote in message news:<3b2f1e4a_at_news.iprimus.com.au>...
> No, I rather think the problem arises from (1) the lack of any *detail*
> about your problem. How about a few table/object definitions, and an idea
> of what relates to what, and an example of what you are trying to achieve?
>
> There is also (2): very few people (in my experience, at any rate) have
> actually made use of the object-relational features of Oracle 8.0 upwards,
> and so you are in a minority to start with (and the cynic in me tells me we
> are about to find out why!)
>
> So, if you give us plenty of information, we might better be able to help.
> And many of us might be able to *learn* about object-relational techniques
> from the various answers that will undoubtedly be forthcoming when the extra
> information is provided.
>
> Regards
> HJR
>
>
>
>
> "Randi Wølner" <randiwolner_at_hotmail.com> wrote in message
> news:9gmsui$hgj$1_at_oslo-nntp.eunet.no...
> > > 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
> > >
> >
> > I know how to join tables when they are designed from a RDB point of view.
> > My current question comes from trying to help a project that is working
> > "object oriented" - trying to store the object model into an Oracle
> > database. The content of the tables are not used as we as "database
people"
> > are used to see them, as columns can be used for more than one purpose -
> > f.ex. one column might hold a reference to the primary key in different
> > tables, as the class is allowed to reference objects of more than one
class.
> >
> > When I wrote that there is a table (class) where they "start" the query -
I
> > meant that this is the table to which they want to compare the search
> > criterias. Then we have to join this table with 4-5 other tables (go
> > "through" them, to find the rows in the "result table" (yes, I know this
is
> > a bad term) - meaning table in which we find the columns that we're
> > searching for.
> >
> > The problem is that - according to the values of some of the columns,
there
> > are in some occations 4, in some 5 tables to be joined. From your answer
> > (and the lack of other response) it seems that this is not a very common
> > problem in the database world - maybe there is another newsgroup I shoud
> > rather try?
> >
> > Best regards,
> > Randi Wølner
> >
> >
Received on Tue Jun 19 2001 - 08:51:48 CDT
![]() |
![]() |