select i.*,s.firstname ,s.lastname from student_Inquiry i inner join studentdetails s on i.Student_InquiryDetail_sno != s.Student_InquiryDetail_sno