IS the assumption that 1 row would be ID IPAddress USer1, USer2,User3And that IPAddress is the way to join the 3 together?Create Table USERS ( ID int identity(1,1),IPAddress varchar(15),User1 varchar(10) not null,User2 varchar(10) null,User3 varchar(10) null)INSERT INTO USERS (IPAddress,User1,User2,User3)SELECT a.IPaddress, a.User1, b.User2,c.User3FROM User1 a left join User2 b on a.IPAddress = b.IPaddress left join User3 b on a.IPAddress = c.IPaddress
Might be more practical to have 1 3 column table which had the ID, a userNo or sequence name, and the associated username. That way you could have any number of users in sequence for the same ID.Create Table USERS ( ID int identity(1,1),IPAddress varchar(15),UserNo int not null,UserName varchar(10))INSERT INTO USERS (IPAddress,USerNo,UserName)SELECT IPaddress, 1, UserName, FROM User1 a UNION ALLSELECT IPaddress, 2, UserName, FROM User2 UNION ALLSELECT IPaddress,3, UserName, FROM User3
Just some options
Poor planning on your part does not constitute an emergency on my part.