三个页面的相关数据库语句

客户信息:
select khbh as 客户编号,
khxm as 客户姓名 ,
(select shouji from lianxifangshi where bianma=a.khbh) as 联系电话,
gcdz as 施工地址,
lpmc as 楼盘名称,
jzmj as 面积,
(select mingcheng from initialize_per where code=a.khjl) as 客户经理,
(select shouji from lianxifangshi where bianma=a.khjl) as 客户经理手机,
(select mingcheng from initialize_per where code=a.sjs) as 设计师 ,
(select shouji from lianxifangshi where bianma=a.sjs) as 设计师手机 ,
(select mingcheng from initialize_per where code=a.zjsjs) as 主材设计师,
(select shouji from lianxifangshi where bianma=a.zjsjs) as 主材设计师手机,
(select mingcheng from initialize_per where code=a.xmjl) as 项目经理,
(select shouji from lianxifangshi where bianma=a.xmjl) as 项目经理手机,
(select mingcheng from initialize_per where code=(select xiangmujingli from paigongdan where khbh=a.khbh)) as 质检,
(select shouji from lianxifangshi where bianma=(select xiangmujingli from paigongdan where khbh=a.khbh))as 质检手机
from sell_khxx a where a.khbh=‘2011070000003‘


维修单
select khbh as 编号,
khxm as 姓名,
(select weixiurenyuan from gongchengweixiudan where khbh=a.khbh) as 维修人员,
(select paichushijian from gongchengweixiudan where khbh=a.khbh) as 维修时间,
(select weixiuneirong from gongchengweixiudan where khbh=a.khbh) as 维修内容,
(select shifoujiejue from gongchengweixiudan where khbh=a.khbh) as 是否解决
from sell_khxx a where a.khbh=‘2011070000001‘

保修单
select khbh as 编号,
khxm as 姓名,
(select shouji from lianxifangshi where bianma=a.khbh)as 联系方式,
gcdz as 地址,
(select mingcheng from initialize_per where code=a.khjl)as 客户经理,
(select mingcheng from initialize_per where code=a.sjs)as 设计师,
(select mingcheng from xcfzr where code=(select xcfzr_code from paigongdan where khbh=a.khbh)) as 施工负责人,
(select kstime from baoxiudan where khbh=a.khbh) as 开始时间,
(select jstime from baoxiudan where khbh=a.khbh) as 结束时间
from sell_khxx a where a.khbh=‘2011070000001‘

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。