GET AVERAGE VALUE FORM TABLE

ezra heywood

Total Post:145

Points:1019
Posted by  ezra heywood
 1270  View(s)
Ratings:
Rate this:

Hi Everyone!

I have a table (tblEmployee) as per bellow

ID Name  Salary
-- -----  ------
1 Mark   15000
2 Samuel  20000
3 Ethon  26000
4 Gotibandhu 15000

I want to select table data based on average value of column

e.g. average of table is

2 Samuel  20000

Thank in advance!

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: get average value form table

    Hi Ezra!

    You can get table data using nested query or sub query, as following

    select * from [tblEmployee] where [salary] = (select avg(salary) from [tblEmployee])

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!