-1

Table A: Col1 [TicketSubject] Col2 [Createuserid] Col3 [Modifyuserid] Table B: Col1 [ID] Col2 [Name]

How I imagine it would work

SELECT a.ticketsubject
      ,a.createuserid
      ,a.modifyuserid
FROM TableA
INNER JOIN TableB ON A.col2 = B.id
INNER JOIN TableB ON A.col3 = B.id

I wish to show create and modify as user name from table2.

  • Not entirely clear what columns from which tables you want; can you add sample data for each table, and expected output? – Mark Stewart Aug 3 '18 at 1:51
1
SELECT a.ticketsubject
     , b.name AS creator
     , c.name AS modifier
  FROM TableA AS a
  JOIN TableB AS b  ON b.id = a.col2
  JOIN TableB AS c  ON c.id = a.col3
;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.