Akhter HUssain

Akhter HUssain

  • 720
  • 1.3k
  • 102.3k

select query with two foreign Key require

Feb 3 2020 8:57 PM
i have data below ,i need select query to fetch record from table like below my
 Ooutput
Patient Group Donor Group
Akhter A Hussain B
 
 
  1. CREATE TABLE #Group(BID INT,BName VARCHAR(50))  
  2. CREATE TABLE #Patient(PID INT,PName VARCHAR(50),BID int)     
  3. CREATE TABLE #Donor(DID INT,DName VARCHAR(50),BID int)  
  4. CREATE TABLE #CrossMatch(CID INT,PID int,DID int)      
  5.     
  6.      
  7. INSERT INTO #Group VALUES(1,'A')      
  8. INSERT INTO #Group VALUES(2,'B')      
  9. INSERT INTO #Patient VALUES(1,'Akhter','1')      
  10. INSERT INTO #Donor VALUES(1,'Hussain','2')     

Answers (2)