SELECT COLUMN VALUE WHICH COLOUMN VALUE IS MAX

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
 1280  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. AVADHESH PATEL

    Post:604

    Points:4228
    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. Shankar M

    Post:25

    Points:175
    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

NEWSLETTER

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