标签:
客户信息:
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‘
标签:
原文地址:http://www.cnblogs.com/yisujian/p/4539260.html