Click here to Skip to main content
15,911,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have tow tables first one it's name Patients

and have those columns

patId
patName
FkpatTypeId


and another table it's name is PatientType

has those columns

PatTypeId
PatType

I want to select from table patient all columns but the last one i want to select it from patient type How can I write this sql statement??
Posted

1 solution

This can be done using simple join
SQL
Select patId, patName, patType from patients 
inner join patientType on FkpatTypeId = PatTypeId
 
Share this answer
 
v2
Comments
Anuja Pawar Indore 27-Jan-12 9:03am    
Added pre tag
fjdiewornncalwe 27-Jan-12 9:48am    
Of course that's it. +5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900