SQL COMPUTE BY Statements

OBJECTIVE

In this chapter you will learn:

About compute by statement
Syntax of compute by statement
Example of compute by statement

 

About compute by statement

The sql clause compute by used with SELECT statement to calculate summary values of the result on a group of data. The column on which the data grouped is declared after BY keyword. It generates the summary report with individual data rows from the table.

Syntax of compute by statement

SELECT column_list from table_name compute aggregate_function (column_name) BY column_name

Example of compute by statement

 

compute-by

SUMMARY

In this chapter you have learned about compute by clause so now try to use this clause with yourself because it will help you to better use. In the next chapter you will learn about select top clause.


Leave a Reply

Your email address will not be published. Required fields are marked *