内部连接仅返回一个表而不是两个表的结果

时间:2017-09-05 08:53:01

标签: sql-server sql-server-2008 tsql

SELECT InvoiceNo as [Invoice No],
       SUM(Quantity) as Quantity,
       SUM(TaxableAmt) as Taxable_Amount,
       SUM(CGSTAmt) as CGST_Amount,
       SUM(SGSTAmt) as SGST_Amount,
       SUM(Amount) as Amount 
FROM tbl_PurchaseDetails    
INNER JOIN tbl_CUSTOMERMASTER 
  ON tbl_CUSTOMERMASTER.PartyID = tbl_PurchaseDetails.PartyID     
GROUP BY tbl_PurchaseDetails.InvoiceNo

上面的查询只返回一个表的结果,而我想要两个表的结果。

显示如下结果:

enter image description here

虽然我想要这样的结果:

enter image description here

0 个答案:

没有答案