my first query is not working and second is working but i want to search a member through group id
select m.mId,(mFName+' '+isnull(mLName,'')) as mname,s.subCatName,s.subCatId,
mAdd,
mContact,mCity,mFather,mQual from tblMemberDetail m
inner join tblMemberCourse c on m.mId=c.mId
inner join tblSubCategory s on c.subcatId=s.subCatId
where mActive = 1 and m.mId=1
select m.mId,(mFName+' '+isnull(mLName,'')) as mname,
g.gName, mAdd,
mContact,mCity,mFather,mQual from tblMemberDetail m
inner join tblMemberCourse c on m.mId=c.mId
inner join tblGroup g on c.gId=g.gId
where mActive = 1 and m.mId=1