From the course: SQL Essential Training

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Nesting functions

Nesting functions

- [Instructor] Now let's take a look at another useful aspect of functions. What I'm referring to is nesting of functions. A nested function is a function that's contained within another function. Now if you recall from our last example which is still in front of us here, we used a number of different aggregate functions to perform different calculations. And if you take a look at the average function, when we look at the result for this, we do see that we have quite a number of digits after our decimal place. Now this is a great candidate to employ nesting, and we could clean this actual number up by nesting our average function. Now before we get into the nesting, we want to nest this in yet another function. An appropriate function here is a new function called the round function, and what the round function does is that it returns a floating point value rounded to the number of digits that you specify. So let's…

Contents