Select from unlink table

Results 1 to 2 of 2

Thread: Select from unlink table

  1. #1
    Join Date
    Dec 1969

    Default Select from unlink table

    I have 3 tables:<BR><BR>Categories<BR>-ID (PK)<BR>-Name<BR>-Description<BR><BR>Databases<BR>-ID (PK)<BR>-CommonName<BR>-ScientificName<BR>-LocalName<BR>-Family<BR>-CategoryID (FK for ID in Categories)<BR><BR>Articles<BR>-ID (PK)<BR>-Name<BR>-Description<BR><BR>If I want to search the text from all 3 tables, how can I join the Articles table since that table has no relationship with either table Categories or Databases.<BR><BR>If the information I want is Categories.Name, Articles.Name, Databases.CommonName, Databases.ScientificName - How should I use the join in this query. <BR><BR>Can someone show me how to solve this. Thanks.......<BR>

  2. #2
    Join Date
    Dec 1969

    Default Question makes no sense.

    If their isn&#039;t any relationship, how can even a *PERSON* know which article goes with which category and/or database???<BR><BR>NOW...*IF* you mean that the Categories.Name and the Articles.Name fields contain the same text, then you can use those fields for a Join just as easily as you can use PK/FK relationships. With the caveat that the join might be much, much slower in performance.<BR><BR>SELECT ...<BR>FROM Categories, Databases, Articles<BR>WHERE Articles.Name = Categories.Name<BR>AND Database.CategoryID = Categories.ID<BR>...<BR><BR>But what happens if you have some Categories.Name that has no matching Articles.Name??? Then you will get *ZERO* records from that SELECT. In which case you might want to do an OUTER JOIN to ensure that all Categories.Name show up whether or not they have a matching Articles.Name.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts