查询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]
用部分数据,能够说明问题就够了,例如十几条记录。作者: kent_73 时间: 2014-6-10 13:05
整理数据很麻烦,算了还是用二个查询吧作者: layaman_999 时间: 2014-6-11 12:00
查询嵌套好像可以用这种方式:
select a.aa, b.bb from (select bb from dd where***) B INNER JOIN cc A ON B.ID = A.ID WHERE.....