×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Join of 4 tables
2

Join of 4 tables

Join of 4 tables

(OP)
Hello!

I'd like to join 4 tables with the following structure:


|-------------------|                |-------------------|
| table1            |                | table2            |
|-------------------|                |-------------------|
|                   |                |                   |
|  field11----------|-------------------field21          |
|  field12          |                |                   |
|        |          |                |                   |
|-------------------|                |-------------------|
         |
         |
|-------------------|                |-------------------|
| table3 |          |                | table4            |
|-------------------|                |-------------------|
|        |          |                |                   |
|  field31          |                |                   |
|  field32----------|-------------------field41          |
|                   |                |                   |
|-------------------|                |-------------------|


The relations in words:

(field11 of table1) : (field21 of table2) = 1:1
(field12 of table2) : (field31 of table3) = 1:n
(field32 of table3) : (field41 of table4) = m:1


How do I write this in a WebFocus Join without joining 2 table then creating a hold file, then joining the other 2 tables and creating another hold file, and finally joining the 2 hold files?

Best regards,
Eva

RE: Join of 4 tables

2

CODE

JOIN FIELD11 IN TABLE1 TO     FIELD21 IN TABLE2 AS J1.
-* table2 is now part of the table1 structure
JOIN FIELD12 IN TABLE1 TO ALL FIELD31 IN TABLE3 AS J2.
-* table3 is now part of the table1 structure
JOIN FIELD32 IN TABLE1 TO     FIELD41 IN TABLE4 AS J3.

A many-to-one JOIN is just many instances of a one-to-one JOIN.

RE: Join of 4 tables

(OP)
Hello focwizard,

thanx a lot. It works fine. Why do I need the "AS J1" ? Where can the join label be used?

Best regards
Eva

RE: Join of 4 tables

The JOIN label is used to selectively clear or re-issue JOINs, as well as in cases of a recursive structure (a file is in the structure more than once), when each instance is not further identified (i.e. through the TAG option).

The DEFAULT 'AS' phrase is ' ' (blank), so if you issued TWO JOINs, without an AS phrase, the second would override the first.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close