首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > VFP >

二个命令,合成一个,该怎么处理

2012-06-02 
二个命令,合成一个,第一个命令如下:TEXT TO m.aall_SQLCmd_FP NOSHOW TEXTMERGEselect A.*,W.vendorid as

二个命令,合成一个,
第一个命令如下:

TEXT TO m.aall_SQLCmd_FP NOSHOW TEXTMERGE 
select A.*,W.vendorid as vendorid,
B.GoodsCode as 物料编码,
C.Goodsname as 物料名称,
D.Goodsstd as 规格型号,
E.Goodsm_unit as 计量单位,
F.vendorCode as 供应商编码,
G.cvenname as 供应商名称,
H.dpbvdate as 发票日期 
  FROM ac_suinv_dtl A 
LEFT JOIN ac_suinv_doc W ON A.invdocid=W.invdocid 
LEFT JOIN ba_goods B ON A.goodsid=B.goodsid  
LEFT JOIN ba_goods C ON A.goodsid=C.goodsid 
LEFT JOIN ba_goods D ON A.goodsid=D.goodsid 
LEFT JOIN ba_goods E ON A.goodsid=E.goodsid 
LEFT JOIN ba_vendor F ON F.vendorid=W.vendorid 
LEFT JOIN ba_vendor G ON G.vendorid=W.vendorid 
LEFT JOIN ac_suinv_doc H ON A.invdocid=H.invdocid 
ENDTEXT
SQLEXEC(nhandle,m.aall_SQLCmd_FP,"all_danju_FP")

第二个命令如下
SELECT "all_danju_FP"
INDEX on dtlid to aaa
brow all

上述命令,本身都没有错,都能正常运行.

要求:第二个命令,只是一个索引,怎么看,都应该可以合并到第一个命令中去.

可是,想啊想,想不出来...

只要向各位老师请教 
 

[解决办法]
TEXT TO m.aall_SQLCmd_FP NOSHOW TEXTMERGE
select A.*,W.vendorid as vendorid,
B.GoodsCode as 物料编码,
C.Goodsname as 物料名称,
D.Goodsstd as 规格型号,
E.Goodsm_unit as 计量单位,
F.vendorCode as 供应商编码,
G.cvenname as 供应商名称,
H.dpbvdate as 发票日期
FROM ac_suinv_dtl A
LEFT JOIN ac_suinv_doc W ON A.invdocid=W.invdocid
LEFT JOIN ba_goods B ON A.goodsid=B.goodsid
LEFT JOIN ba_goods C ON A.goodsid=C.goodsid
LEFT JOIN ba_goods D ON A.goodsid=D.goodsid
LEFT JOIN ba_goods E ON A.goodsid=E.goodsid
LEFT JOIN ba_vendor F ON F.vendorid=W.vendorid
LEFT JOIN ba_vendor G ON G.vendorid=W.vendorid
LEFT JOIN ac_suinv_doc H ON A.invdocid=H.invdocid
Order By 表名.字段名  
ENDTEXT

热点排行