Re: Creating View



IronSights,

You are asking about an OUTER JOIN such as:

CREATE MyView
AS
SELECT A.*, B.*, C.* -- Specify column names in real life
FROM Table1 A
JOIN Table2 B
ON A.ID = B.ID
LEFT OUTER JOIN Table3 C
ON A.ID = C.ID

Of course, the C.* columns will return NULL since no data exists, but the
row will show up in your view.

RLF
"IronSights" <IronSights@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CDAFBEE7-2D51-4121-9CEA-9D70A873815D@xxxxxxxxxxxxxxxx
I have a database I am working with that has three tables in it.

Two of the tables will be filled with information once a record is
submitted. The other one requires a response and will only get populated
with
information when another transaction is fired.

(i.e. Record Submission sends an e-mail with an html link. When the link
is
clicked by a user it loads an ASPX page that will fire a stored procedure
that creates a record in the third table that identifies the submission
has
been viewed by someone on staff)

The problem I am running into with the view is that it will only retun
records that have been 'viewed' by someone. How can I do the view where it
will return all records regardless if a record exist in the child table?

The Table is joined with a PK and FK relationship.

If no PK from the master table exist as a FK in the child table I do not
get
the reults.

I want to be able to see all records regardless if they have been viewed
are
not. Can this be done?



.



Relevant Pages

  • I dont understand the results of my hierarchical query
    ... query on my tables, but I didn't get the results I expected. ... SQL> select parent, child from graph; ... LEFT OUTER JOIN graph ...
    (comp.databases.oracle.server)
  • Re: Sqlexec - Outer Joins
    ... > I am having trouble with the syntax using SQLEXECas it relates to ... To go a little further with what Jack said, you don't want an outer join at ... all since you want rows from the child table only if the parent table has a ... there was no matching child row. ...
    (microsoft.public.fox.vfp.queries-sql)