2011-04-21 2 views
0

'안녕 모두 ' '쿼리가 작동하지만 BD 테이블 (B_Detail)에서 데이터를 가져 오지 못합니다. '무엇이 잘못 되었나요? '두 번째 테이블에서 데이터를 가져 오지 못함

SELECT CM.CM_Date AS Cdate, CM.C_MemoNo AS CmNo,0 as BookDate, 0 as LR_No, 
CM.CM_Total as CMAmt, 0 as Amt_Rcvd, 0 as ChqDDNo, 0 as ChqDDdate, 0 as Acc_Typ, 
0 as RcptNo,0 as MemoNo, 0 as M_Date, CM.CNee as conName 
from (CMemo as CM 
INNER JOIN ClientLedger ON (ClientLedger.CName = CM.CNee)) 
UNION ALL 
Select 0 as Rcpt_Date, 0 as CmNo, BD.Bdate as BookDate, BD.BNo as LR_No, 
0 as CM_Total, 0 as Amt_Rcvd, 0 as ChqDDNo, 0 as ChqDDdate, 0 as Acc_Typ, 
0 as RcptNo,BD.CST as MNo, BD.GRDate as M_Date, BD.Consignee 
from (B_Detail BD 
INNER JOIN Receipt_CLNT CM ON (CM.CNee = BD.Consignee)) 
UNION ALL 
SELECT Receipt_CLNT.Rcpt_Date, 0 as CmNo, 0 as BookDate, 0 as LR_No, 
0 as CM_Total, Receipt_CLNT.Amt_Rcvd as RcptAmt,Receipt_CLNT.ChqDDNo as RefNo, 
Receipt_CLNT.ChqDDdate as RefDate, Receipt_CLNT.Amt_Mode as Mode, 
Receipt_CLNT.RcptNo as RcptNo, 0 as MemoNo, 0 as MDate, Receipt_CLNT.G_Name 
from Receipt_CLNT 
ORDER BY Cdate; 

답변

0

문제가있는 부분 만 질문을 단순화해도 여전히 데이터가 반환되지 않습니까?

Select 0 as Rcpt_Date, 0 as CmNo, BD.Bdate as BookDate, BD.BNo as LR_No, 
     0 as CM_Total, 0 as Amt_Rcvd, 0 as ChqDDNo, 0 as ChqDDdate, 0 as Acc_Typ, 
     0 as RcptNo,BD.CST as MNo, BD.GRDate as M_Date, BD.Consignee 
from (B_Detail BD 
INNER JOIN Receipt_CLNT CM ON (CM.CNee = BD.Consignee)) 

그러면 조인 (내부 조인)이 키와 일치하지 않습니다. CM.CNee = BD.Consignee

+0

답장을 보내 주셔서 감사합니다. 그 날 (CM.CNee) 매개 변수를 넣어 묻는이 문제를 해결하는 방법을 보여주십시오. – Marty

+0

질문이 무엇인지 모르겠습니다. –

+0

BD 테이블에서 데이터를 가져 오지 못합니다. – Marty

관련 문제