If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Corel Paradox > New To Sql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-13-03, 18:09
stuman413 stuman413 is offline
Registered User
 
Join Date: Sep 2003
Location: Richmond, CA
Posts: 11
New To Sql

I am new to sql and have a project that requires me to join multiple tables. Currently I am trying to join two tables that both have names and addresses of people. One table is of adults and the other is of children with supervising adults. I have been able to create a join of both of them, but, for instance, when an adult is listed as the supervising adult for a child, the adult list is almost doubled in size making the table an untrue reflection of what I am trying to achieve. Can anyone help me with this problem?

thanks

stu
Reply With Quote
  #2 (permalink)  
Old 10-21-03, 11:41
Maroonotmoron Maroonotmoron is offline
Registered User
 
Join Date: Sep 2003
Location: Dallas
Posts: 182
Need more information on fields and what you are trying to join to. If you want a single list on names than you may want to list All children, All Adults and, All supervising Adults not in the adult list.
Reply With Quote
  #3 (permalink)  
Old 10-21-03, 11:44
Maroonotmoron Maroonotmoron is offline
Registered User
 
Join Date: Sep 2003
Location: Dallas
Posts: 182
Need more information on fields and what you are trying to join to. If you want a single list on names than you may want to list All children, All Adults and, All supervising Adults not in the adult list.

Or you may only want all adults and All children.

What you want will determine your query/join
Reply With Quote
  #4 (permalink)  
Old 10-21-03, 12:03
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
Re: New To Sql

Quote:
Originally posted by stuman413
I am new to sql and have a project that requires me to join multiple tables. Currently I am trying to join two tables that both have names and addresses of people. One table is of adults and the other is of children with supervising adults. I have been able to create a join of both of them, but, for instance, when an adult is listed as the supervising adult for a child, the adult list is almost doubled in size making the table an untrue reflection of what I am trying to achieve. Can anyone help me with this problem?

If a parent has two children then a join will produce a {parent, child} row for each child; thus the parent's name will indeed be listed twice. Perhaps you should state what the result is that you want. Do you want "all parents, with their name and address?" In that case your query might involve the Child table but have no checkmarked fields (QBE grid) or would list only fields from the Parent table in the SELECT clause {listing the child table only in the JOIN clause}.

Also don't overlook the idea of running two queries in a row. Run one to get the base results... even with duplicated parents... then query that answer-table to select the parent-name, address, and so-on. Then run your report or what-have-you from that second result table.

"Anything that gets you what you want" will work just as well.
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On