1. 根据一个保单号grpcontno 查询出 投保单位的地址信息, 省,市 县 详细地址
select province||city||country||grpaddress from lcgrpaddress la inner join lcgrpappnt lc on la.customerno = lc.customerno and la.addressno = lc.addressno where grpcontno='GA01019900000212'
2. 根据一个保单号 查询出 保单下有那些计划, 计划编码, 计划名称
select contplancode ,contplanname from lccontplan where grpcontno='GA01019900000212'
3。 根据一个 人的名称, 人的idno 查询出 这个人 是那些保单的被保人,
select grpcontno from lccont where insuredname='一号被保人'and lccont.insuredIdno='123456'
4、 根据 一个保单号 一个人的 name,idno , 查询出 这个人有哪些险种, 每个险种的保费是多少。
select lm.riskname ,lp.prem from lccont lc inner join lcpol lp on lp.contno = lc.contno inner join lmriskapp lm on lm.riskcode=lp.riskcode
where lp.grpcontno='GA01019900000212'and lc.insuredname='一号被保人' and lc.insuredIdno='123456'
5、 根据 一个保单号 一个人的 name,idno , 查询出 这个人有哪些责任, 每个责任的保费是多少。
select dutyname ,lc.prem from lccont la inner join lcpol lb on la.contno=lb.contno inner join lcduty lc on lb.polno=lc.polno inner join lmduty ld on ld.dutycode=lc.dutycode
where lb.grpcontno='GA01019900000212' and la.insuredname='一号被保人' and la.insuredIdno='123456'
6、 根据一个保单号, 查询出 总共有多少被保人, 共有多少保费
select count(countno),sum(prem) from lccont where grpcontno='GA01019900000212'