Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is a Join?
Message
From
07/08/2003 13:13:25
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00817819
Message ID:
00817837
Views:
23
>Hey everyone,
>I'm trying to show someone what a great resource the UT is. Somebody wanna explain to us what a left join is? Thanks,
>

When a query involves more than one table, you need a way to indicate how to match the records from the two tables up. Doing so is called "joining" the tables and the code that specifies it is a "join."

By default, only records that match in the two tables are joined. For example, if you join Customers and Invoices, only customers who have an invoice on file show up in the result. This is called an "inner join."

Sometimes, you want to see all the records from one table or the other, even if there's no match. This type of join is called an "outer join."

There are three types of outer joins:
- In a "left join," all the records from the first table listed are included in the result, along with any matches from the second table.
- In a "right join," all records from the second table are included in the result, along with any matches from the first table.
- In a "full join," all records from both tables are included in the result, matched up as possible.

When a record from one table has no match in the other, any fields from the unmatched table in the result are given the null value.

Hope that's enough information for starters.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform