Recruitment programming question?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • teek5449
    New Member
    • Jul 2007
    • 9

    Recruitment programming question?

    Today I was given a question that I may be asked in a job interview for a IT position at a local company. I drew a blank on this seemingly simple problem and have been racking my brain.

    Given:

    Code:
    Table Old
        Year    Month   Serial#   Batch#
        2007    Jan     101       MW
        2007    Jan     101       TR
    Problem:
    Take the given table and show how you would generate the following resulting table.

    Code:
    Table New
        Year    Month    Serial#    Batch01#    Batch02#    Batch03#
        2007    Jan      101        MW          TR          null

    Basically the Batch# must be combined into a new row where the other data is the same.

    I am having a brain freeze ont his one and am would love to see a simple and elegant solution to this seemingly easy problem.

    Thank you in advance for any help that you may provide.
  • uzairahm
    New Member
    • Jun 2007
    • 11

    #2
    Well through new feature of SQl Server 2005 which is Pivot this issue could easily be solved. Don't wanna spoil u'r fun by telling u the exact solution. Hope you will figure it out if you can't tell me then surely i will tell u the exact solution.

    Comment

    • teek5449
      New Member
      • Jul 2007
      • 9

      #3
      Well you might as well spoil the ending :) and thank you.

      Comment

      Working...