id cid aid Question27 1 21 what is bca?28 1 21 what is eee?29 2 22 what is ba ?30 2 22 what is aa?31 4 23 what is bsc?32 4 23 what is bbb?35 1 24 what is dddd?36 1 24 what is ggg?37 4 23 what is ccc?38 9 25 what is v?39 1 21 what is ggg?40 1 21 what is sas?41 1 21 What is Inheritance?

Columns shown in Output and in Query are not matching.
select asm.id,asm.aid,asm.question,asn.id,asn.aid,asn.answer from assignmentquestion asm
inner join assignmentanswer asn on asm.aid=asn.aid and asm.id=asn.[b]qid[/b] where asn.sid=6 and asn.aid=21