Please enable JavaScript to view this site.

R:BASE 11 Beginners Tutorial

Navigation: Lesson 3 - Viewing Data

Selecting Columns for a View

Scroll Prev Top Next More

Next, select the columns from each table to include in the view. We'll select the CustomerID, CustomerLastName, and CustomerCompany columns from the Customer table first.

 

To select the columns from the Customer table:

 

1.In the "Query Builder" window, select the table "Customer" from the list of "Tables/Views In Use" and click the right mouse button.
2.From the context menu, choose "Select Columns".

 

The "Table: [Customer]" dialog box is displayed. The columns from the Customer table are listed in the "Column Name" panel.

 

3.Select "CustomerID" in "Column Name" and click the Add button.

 

You will be asked to create an alias name for the column. Select "OK", and R:BASE will assign the column alias name for you. R:BASE includes the table alias to explicitly connect each column to its table. "T1.CustomerID" is added to "Current Selection:".

 

4.Repeat this step to add CustomerLastName and CustomerCompany.

 

"Current Selection" lists the three columns 'T1.CustomerID," "T1.CustomerLastName," and "T1.CustomerCompany." The alias name "T1" identifies these columns as belonging to the Customer table.

 

5.Click the OK button.

 

The SELECT syntax should be displayed like the following:

 

SELECT_View2

 

 

You have now selected all the columns from the Customer table that will be included in FlightView. Next, we'll select the columns we want from the Flights table.

 

To select the columns from the Flights table:

 

1.In the "Query Builder" window, select the table "Flights" from the list of "Tables/Views In Use" and click the right mouse button.
2.From the context menu, choose Select Columns.

 

The "Table: [Flights]" dialog box is displayed. The columns from the Flights table are listed in "Column Name."

 

3.Select the following columns from Flights to include in the view: FlightDate, Slogan, Place, and TotalCharge and do not add any column aliases.

 

The columns you select are identified with the table alias "T2," the alias name R:BASE assigned to the Flights table.

 

4.Click the OK button.

 

The SELECT syntax should be displayed like the following to include the columns selected from the Flights table:

 

SELECT_View3

 

 

You will notice that R:BASE automatically recognized the common column and established the link. The WHERE clause in the SELECT syntax panel reads "T1.CustomerID = T2.CustomerID".

 

The query for this view is complete. Before we save the query as a view, let's look at the results of the query.