Select column value which coloumn value is max

Total Post:341

Points:2389

 1725  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 name which Employee salary is max

Please help me!

  1. Re: Select column value which coloumn value is max

    Hi Ankit!

    You can get name using nested query or sub query, as following

    select [name] from [tblEmployee] where [salary] = (select max(salary) from [tblEmployee])

  1. Re: Select column value which coloumn value is max

    Hi Ankit,


    You can give a try to this one,

    SELECT TOP 1 * FROM tblEmployee ORDER BY SALARY DESC

    Thanks,
    Shankar

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.