Click here to Skip to main content
15,894,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have Two table Student_mst and medical_mst
in Student_mst columnName-rollno(primary key),name,sem ..
in medical_mst columnName-rollno(frn. Key), blood_grup ..
I Need Only Those Records Who records are not avilable in medical_mst Table
Please Help.
Posted
Updated 9-Jan-14 19:57pm
v2

SQL
SELECT sm.rollno, sm.name, sm.[any other column name] FROM Student_mst sm
WHERE NOT EXISTS
(
SELECT * FROM medical_mst mm WHERE mm.rollno = sm.rollno
)
 
Share this answer
 
Comments
Avadhesh yadav 10-Jan-14 23:19pm    
Thanks Mr. Tejas & Peter
you can make your query something like this...

SQL
SELECT Student_mst.* FROM Student_mst
WHERE rollno NOT IN (SELECT rollno FROM medical_mst)
 
Share this answer
 

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