Customer Information:
Select KHBH as customer number,
KHXM as Customer name,
(select Shouji from Lianxifangshi where BIANMA=A.KHBH) as contact telephone,
Gcdz as construction address,
LPMC as property name,
JZMJ as Area,
(select Mingcheng from Initialize_per where CODE=A.KHJL) as Account Manager,
(select Shouji from Lianxifangshi where BIANMA=A.KHJL) as Account Manager phone,
(select Mingcheng from Initialize_per where Code=a.sjs) as designer,
(select Shouji from Lianxifangshi where Bianma=a.sjs) as designer phones,
(select Mingcheng from Initialize_per where Code=a.zjsjs) as main material designer,
(select Shouji from Lianxifangshi where Bianma=a.zjsjs) as main material designer mobile phone,
(select Mingcheng from Initialize_per where CODE=A.XMJL) as project manager,
(select Shouji from Lianxifangshi where BIANMA=A.XMJL) as project manager phone,
(select Mingcheng from Initialize_per where code= (select Xiangmujingli from Paigongdan where KHBH=A.KHBH)) as quality inspection,
(select Shouji from Lianxifangshi where bianma= (select Xiangmujingli from Paigongdan where KHBH=A.KHBH)) as quality phone
From Sell_khxx a where a.khbh= ' 2011070000003 '
Repair Order
Select KHBH as number,
KHXM as name,
(select Weixiurenyuan from Gongchengweixiudan where KHBH=A.KHBH) as maintenance personnel,
(select Paichushijian from Gongchengweixiudan where KHBH=A.KHBH) as repair time,
(select Weixiuneirong from Gongchengweixiudan where KHBH=A.KHBH) as repair content,
(select Shifoujiejue from Gongchengweixiudan where KHBH=A.KHBH) as is resolved
From Sell_khxx a where a.khbh= ' 2011070000001 '
Warranty Form
Select KHBH as number,
KHXM as name,
(select Shouji from Lianxifangshi where BIANMA=A.KHBH) as contact method,
Gcdz as Address,
(select Mingcheng from Initialize_per where CODE=A.KHJL) as Account Manager,
(select Mingcheng from Initialize_per where Code=a.sjs) as designer,
(select Mingcheng from XCFZR where code= (select Xcfzr_code from Paigongdan where KHBH=A.KHBH)) as construction leader,
(select Kstime from Baoxiudan where KHBH=A.KHBH) as start time,
(select Jstime from Baoxiudan where KHBH=A.KHBH) as end time
From Sell_khxx a where a.khbh= ' 2011070000001 '
Three pages of related database statements