Compute Frequency Of Each Element In Column using SQL 2008

In this article I am going to explain how to Find Frequency Of Each Element In Column.
  • 3496

Introduction

Frequency of each element in column means number of occurrence of particular element in a column.

Example

Suppose we have a table named "Employee" given in following image and we need to find out the frequency of each salary of employee.

CreateTable-in-sqlserver.jpg

Following SQL query will find out the frequency distribution of salary in Employee table.

Get-Frequency-in-sql.jpg

Categories

More Articles

© 2018 DotNetHeaven. All rights reserved.