Forum Replies Created

Viewing post 1 (of 2 total)

  • RE: combining tables

    try this:

    [font="System"]SELECT

    employeeID, dateHired, employeeName, max([2010Salary]), max([2011Salary])

    FROM (

    SELECT

    employeeID, dateHired, employeeName, salary as [2010Salary], 0 as [2011Salary]

    FROM [2010Table]

    UNION

    SELECT

    employeeID, dateHired, employeeName, 0 as [2010Salary], salary as [2011Salary]

    FROM [2011Table]

    )x

    GROUP BY

    employeeID, dateHired, employeeName[/font]

Viewing post 1 (of 2 total)