运行查询时双行

时间:2016-08-25 09:36:23

标签: sql join axapta dynamics-ax-2012

我正在使用查询:

SELECT SALESQUOTATIONLINE.QUOTATIONID, SALESQUOTATIONLINE.CREATEDDATETIME, 
       SALESQUOTATIONLINE.CUSTACCOUNT AS CustomerAccount, SALESQUOTATIONLINE.COMPANY, 
       SALESQUOTATIONLINE.DELIVERYNAME, SALESQUOTATIONLINE.LINENUM AS LineNumber, 
       SALESQUOTATIONLINE.ITEMID, SALESQUOTATIONLINE.NAME AS ItemName, SALESQUOTATIONLINE.QTYORDERED, 
       SALESQUOTATIONLINE.SALESQTY, SALESQUOTATIONLINE.REMAININVENTPHYSICAL, 
       SALESQUOTATIONLINE.REMAINSALESPHYSICAL, SALESQUOTATIONLINE.CURRENCYCODE, 
       SALESQUOTATIONLINE.SALESPRICE, SALESQUOTATIONLINE.PRICEUNIT, SALESQUOTATIONLINE.LINEAMOUNT, 
       SALESQUOTATIONLINE.SALESUNIT, SALESQUOTATIONLINE.COSTPRICE, 
       SALESQUOTATIONLINE.QBE_LINESTATUS AS LineStatus, SALESQUOTATIONLINE.ISSM_LINEREALISTIC AS LineRealistic, 
       SALESQUOTATIONLINE.QBE_MARGE AS Marge, SALESQUOTATIONLINE.QBE_MARGEPERCENTTA AS MargePercentTA, 
       SALESQUOTATIONLINE.RECEIPTDATEREQUESTED, SALESQUOTATIONLINE.SHIPPINGDATEREQUESTED, 
       SALESQUOTATIONLINE.CONFIRMEDDLV, SALESQUOTATIONLINE.QBE_DLVTIMEQUOTATION AS DlvTimeQuotation, 
       SALESQUOTATIONLINE.QBE_DLVTIMEQUOTSPEC AS DlvTimeQuotSpec, SALESQUOTATIONLINE.CUSTOMERREF, 
       SALESQUOTATIONLINE.DEFAULTDIMENSION, tb1.PERSONNELNUMBER AS WorkerSalesResponsibleCode, tb1.QBE_EMPLTYPE AS EmployeeType, 
       tb2.PERSONNELNUMBER AS WorkerSalesTakerCode, SALESQUOTATIONTABLE.BUSRELACCOUNT AS BusRelAccount, 
       SMMBUSRELTABLE.ELG_REVENUECATID AS RevenueCatId, SMMBUSRELTABLE.POTENTIAL AS Potential
FROM SALESQUOTATIONLINE 
INNER JOIN SALESQUOTATIONTABLE ON SALESQUOTATIONTABLE.QUOTATIONID = SALESQUOTATIONLINE.QUOTATIONID 
INNER JOIN SMMBUSRELTABLE ON SMMBUSRELTABLE.BUSRELACCOUNT = SALESQUOTATIONTABLE.BUSRELACCOUNT 
INNER JOIN HCMWORKER AS tb1 ON tb1.RECID = SALESQUOTATIONTABLE.WORKERSALESRESPONSIBLE 
INNER JOIN HCMWORKER AS tb2 ON tb2.RECID = SALESQUOTATIONTABLE.WORKERSALESTAKER

目前我添加了联接:

INNER JOIN SMMBUSRELTABLE ON SMMBUSRELTABLE.BUSRELACCOUNT = SALESQUOTATIONTABLE.BUSRELACCOUNT`

我获得了具有不同RevenueCatId en Potential的双行(两个1空白,1个带有实际记录信息)。

这次JOIN我做错了什么?

0 个答案:

没有答案