You must Sign In to post a response.
  • Category: ASP.NET

    Write a query to get max salary details for each department

    write a query to get max salary details for each department
  • #476005
    why dont you write the query yourself! and post the errors u face in the query
    -----------------------------------
    Life is a race,tez nahi bhagoge to log kuchalke agey niklenge!

  • #476011
    Hi,

    Try this :

    select max(salary) as 'Amount' from tableName where deptName='Accounts'

  • #476013
    thanks lakshmi but i want the max salary from all departments..

  • #476015
    Hi,

    Try this :

    select max(salary) as 'Amount' from tableName where deptName='Accounts'and deptName='EDP' and deptName='Sales' and deptName='Purchase'

  • #476018
    select max(salary) as 'Amount' from tableName group by department

  • #476021
    Hi,

    Also try this :

    select max(salary) as 'ACC Salary' from tableName where deptName='Accounts'
    UNION
    select max(salary) as 'EDP Salary' from tableName where deptName='EDP'
    UNION
    select max(salary) as 'Sales Salary' from tableName where deptName='Sales'
    UNION
    select max(salary) as 'Purchase Salary' from tableName where deptName='Purchase'

  • #476029
    hi

    select max(salary) as salarymax from tablename

    Thanks&Regards
    Venkatesh.P

  • #476044
    thanks to all for your Quick response

  • #476048
    select max(salary) as 'Amount' from tableName where deptName='DEPT'
    Regards,
    Kiran.

  • #476066
    select max(salary) As 'SalaryAmount) from urtablename where ur departmentname='"+txtdeptname+"'.
    Thanks And Regards,
    C.Mallikarjuna

  • #476154
    select max(salary) from tableName where deptName='xx'
    DNS MVM and .Net Guru
    Team Lead at CirrusCloud Systems
    Bhubaneswar,Odisha
    Thanks and Regards,
    Abhay Kumar Raut


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.