combining two tables with similar structure

  • Hi,

    I'm trying to write a SELECT statement to retrieve users from two tables. The structure is as follows:

    activeUsers

    userID, firstName, lastName, pwd, activeSince

    'jacob888', 'Jacob', 'Bruno', 'password', 09/24/2004

    inactiveUsers

    userID, firstName, lastName, pwd, activeSince, inactiveReason, inactiveSince

    'neurologist', 'Brian', 'Jennings', 'protected', 01/18/2004, 'stole from colleagues', 03/09/2005

    I just want to get a list of all the userIDs, firstNames and lastNames. How do I do this?

    Thanks in advance!

  • Select userID, firstName, lastName from dbo.ActiveUsers

    union all

    Select userID, firstName, lastName from dbo.InactiveUsers

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply