|
本帖最后由 kent_73 于 2014-6-10 10:02 编辑
查询1:
SELECT a.Fhth AS hth, c.FHelpCode & '/' & b.fname AS pf, e.[FName] & "/" & f.[fname] AS tx, d.Fzss AS zss
FROM dbo_t_cz_Jgzss AS a INNER JOIN dbo_t_Item AS b INNER JOIN dbo_t_ICItem AS c ON b.FItemID = c.FcolorNo ON a.Fitemid = c.FItemID INNER JOIN dbo_t_cz_jgzssentry AS d ON a.FID = d.FID INNER JOIN Rq_tx AS e ON d.Ftx = e.FItemID INNER JOIN Rq_cm AS f ON d.Fcc = f.FItemID
查询2:
SELECT a.OrderNo as hth, a.Style as pf, [Color] & "/" & [Sizx] AS tx, Sum(b.Qty) AS sl FROM pywrkord as a INNER JOIN pybundle as b ON a.WrkOrder = b.WrkOrder GROUP BY a.OrderNo, a.Style, [Color] & "/" & [Sizx]
怎样将上面二个查询,合并成一个,并得到下面的结果:
查询1.hth,查询1.pf,查询1.tx,查询1.zss,查询2.sl
二个查询间的关系:查询1.hth=查询2.hth,查询1.tx=查询2.tx,查询1.pf=查询2.pf,但是查询1的pf是二个字段结果,查询2的pf是一个字段的结果,这样的关系怎么建立?
|
|