nested select (SQL Server) -


I'm not sure how to get it.

I have something like this Table: Visit IID, Personal 1, Personia 2 Tableb: Personiaad, Firstname, LastLame

I would like to go back to ID, PersonID1 name, name personID2.

Generally I just join a simple, but I do not seem to do such a thing

It should do something

  SELECT A.VisitID, B.FirstName + B.ListName, B.FirstName + B.ListName (this is a work, used to work) Table A to TableA.PersonID1 = TableB.PersonID or TableA.PersonID2 = TableB on a host TableB B .Personid   

Thanks!

You tableb twice, once for each ID:

  select VisitID, B1. First name, b 1.lastname, b2 First name, B2 TableB.PersonID1 = b1 on table B1 in injection from table. PersonID is included in 2 Table B in internal TableB. PersonID2 = b2.PersonID    

Comments