CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Posts
    16

    How to multiply two columns & sum it?


    How to find the sum of salary departmentwise after the increment from the following table?

    EmpId ** DeptId ** Salary ** %OfIncrement

    001 ***** 100 ***** 20000 ***** 30
    002 ***** 100 ***** 15000 ***** 25
    003 ***** 200 ***** 10000 ***** 15
    004 ***** 200 ***** 17500 ***** 10


    I want the SQL statement which gives the following

    DeptId ***** SumOfSalary

    SumOfSalary is the sum of (Salary * %OfIncrement / 100) departmentwise


    muralirajan

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to multiply two columns & sum it?

    select sum (salary *...)/100 group by deptid

    What do you think this forum is for? If you need a contract programmer, I'll be happy to send you my rates :-)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured