O'Reilly logo

Visual Basic® .NET Database Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Joins

A join is query that selects more than one table. Normally the tables are linked by fields that have the same meaning. The linking fields do not need to have the same names, although joins are less confusing if the do.

Suppose the Students table has a StudentId field. The TestScores table also has a StudentId field indicating the student who got a particular score. The two StudentId fields link the tables. The following query joins the two tables to select student information from the Students table plus test scores from the TestScores table:

SELECT TestNumber, LastName, FirstName, Score 
FROM Students, TestScores 
WHERE Students.StudentId = TestScores.StudentId 
ORDER BY TestNumber, LastName, FirstName, Score 

In many cases, that’s as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required