From the course: Access 2021: Queries
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Nest SQL code in other queries
From the course: Access 2021: Queries
Nest SQL code in other queries
- [Instructor] Occasionally, you may find the technique of embedding a SQL select statement inside of other queries to be helpful in organizing your data. Sometimes this is referred to as a subquery, or an inner query, or a nested query. Whatever you call it, though, the technique can be quite useful. Let's take a look at an example by creating an new query in Design View. Now, sometimes you want to include records in your query based upon the results of another query. Often this may include a calculation based upon your data. For instance, I'd like to see some details about our customers orders, and also be able to see when they placed their last order with Red30Tech, if they're a returning customer. From the Add Tables panel, I'll add in the Customers table, the Orders table, and the Products table. From the Customers table, we'll pull down the CustomerID, FirstName and LastName fields. From the Orders table,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.