December 6, 2009 at 7:35 pm
Hi Guys
I have got two table as below
Table 1
Tests Patient_id date
qw 1 1/2/2000
wewe 2 1/12/2005
cdd 1 12/03/2008
.
.
bfs 3 13/12/2004
ddd 2 01/01/2003
Table 2
Patient_id
1
2
3
34
666
8888
I want to display the records from table 1 of those patients where patient_id of table 1 matches with the patient_id of table 2
Cheers
December 6, 2009 at 7:55 pm
This should work.
SELECT T1.Tests, T1.Patient_Id, T1.Date from Table1 T1
Inner Join Table2 T2
ON T1.Patient_ID = T2.Patient_ID
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
December 6, 2009 at 8:12 pm
Nuts (12/6/2009)
I want to display the records from table 1 of those patients where patient_id of table 1 matches with the patient_id of table 2
Based soley on the question, I strongly recommend you visit the following website...
http://www.w3schools.com/sql/default.asp
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply