select
t.Sno, t.childid,
(select customername as n from customerprofile c where c.cusid = t.childid) as name,t.earnedmoney as commission,
(select p.bookingamt from propertyregistration p, customerprofile c where p.applicationno = c.applicationno and c.cusid = t.childid) as bookingamt,
(select p.totalarea from propertyregistration p, customerprofile c where p.applicationno = c.applicationno and c.cusid = t.childid) as totalarea ,
(select childid from tbl_level where parentid = t.childid) as child
from
tbl_level t
where
parentid = @id
这是程序,其中
(select childid from tbl_level where parentid = t.childid) as child
如果有单条记录,它很容易获取
有多个记录,它抛出一个错误,子查询返回多个值
请帮助我如何检索多条记录