Forums - C# Corner

Forum guidelines
Prakash Mondal

Prakash Mondal

  • 1.4k
  • 67
  • 65.4k

Joining Problem

Dec 7 2017 4:40 AM
Suppose Table: stu_mas, stu_fees_mst, stu_fees_details
 
stu_mas:
 stu_id  stu_name
 STU-1001  RABIN PANDAY
 
stu_mst
 recpt_id  stu_id  total
 R-1001  STU-1001  5000
 
stu_fees_details
 recpt_id_pk  slno  fees purpose
R-1001
1
4000
admission fees
R-1001
2
1000
library fees

Output will happen:
 
 stu_id  stu_name  recpt_id  slno  fees purpose
 STU-1001 RABIN PANDAY
R-1001 1  4000 admission fees
STU-1001
RABIN PANDAY
R-1001
2
1000
library fees
 
Query is:
 
selec * from
( select * from stu_fees_details where recpt_id_pk in(select recpt_id from stu_mst) ) as a
left join (select * from stu_mst) as b on a.recpt_id_pk=b.recpt_id
left join
(select * from stu_mas) as c b.stu_id=c.stu_id
 
But display ERROR.
 
Please solve this

Answers (1)