Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    5

    Unanswered: Answer to a complicated sql query

    Hi,

    I need urgent answer to this query. Need to write a sql query to get table 3-11 from 3-10

    Calculate the employee attrition Table 3-11 from the Employee master, Table 3-10

    Table 3-10: Employee Master

    Employee ID Start Date Termination Date Performance Level
    1 1/1/2007 3/1/2007 Low
    2 6/5/2004 Medium
    3 4/3/2003 High
    4 9/1/2002 4/15/2007 Medium
    5 4/6/2007 11/1/2007 Low
    6 7/1/2007 High
    7 3/2/2005 8/1/2007 Low

    Table 3-11: Employee Attrition

    Period Total Employees at end of quarter High Performers Medium Performers Low Performers Total Attrition Low Performer Attrition Medium Performer Attrition High Performer Attrition
    Q1 2007 4 1 2 1 1 1 0 0
    Q2 2007 4 1 1 2 1 0 1 0
    Q3 2007 4 2 1 1 1 1 0 0
    Q4 2007 3 2 1 0 1 1 0 0
    Last edited by sqlprogrammer1; 02-17-12 at 01:24. Reason: Adding more details

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    The question was in Microsoft SQL Server forum, too.
    Quote Originally Posted by sqlprogrammer1 View Post
    I need urgent answer to this query. I need a sql query to get 3-11 table from 3-10

    Calculate the employee attrition Table 3-11 from the Employee master, Table 3-10

    ...

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    desperate sql student is desperate
    homework is due and she hasn't a clue
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Tags for this Thread

Posting Permissions

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