From the course: Oracle Database 12c: Advanced SQL
Unlock the full course today
Join today to access over 23,100 courses taught by industry experts.
Using inline views - Oracle Database Tutorial
From the course: Oracle Database 12c: Advanced SQL
Using inline views
- [Instructor] When a multi-column subquery is used in the FROM clause of the external query, it is also known as an inline view, which is essentially a virtual or temporary table that is created by the inner query for the purpose of the external query. When using inline views in Oracle, as we'll see in a moment, the result of the subquery are treated like any other table would be in the FROM clause of a SQL query. Let's see an example of using inline views. We will start with a query which counts how many employees are assigned to each department. You will find a sample query provided in your exercise file. So, let's copy this query and paste it to our SQL Developer window. Note that we are using the aggregative count function for this query. So, let's run this query, and see that we got our data back. So again, we are returning how many employees are assigned to each department. So far so good. Now, what if we want to also display the department name? We can use this query as a…
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.