나는 세 개의 테이블을 가지고 ...
1) t_quoteMasterSQL에서 중복없이 세 개의 테이블을 조인하는 방법?
quoteId quoteNo quoteDate custName itemName itemQty itemPrice itemToal
10 2 17/10/17 cust1 item1 2 100 200
11 2 17/10/17 cust1 item2 5 20 100
2
productId productName productHSN productUnit productPrice
15 item1 1111111111 kg 100
16 item2 2222222222 gram 20
17 item3 3333333333 kg 50
지금 내가 CUSTNAME에 테이블을 조인 할 t_productMaster) t_custMaster
custId custName custAddress custGSTIN custPhone
10 cust1 US 123456789 123456789
11 cust2 UK 987654321 987654321
3) itemName ..
결과는 ..이어야합니다. 각각를 ITEMNAME 10
quoteId quoteNo quoteDate custName itemName itemQty itemPrice itemToal productHSN productUnit custAddress custGSTIN
10 2 17/10/17 cust1 item1 2 100 200 1111111111 kg US 123456789
11 2 17/10/17 cust1 item2 5 20 100 2222222222 gram US 123456789
난 CUSTNAME 및 에 기초 에서 에서 t_productMaster을 t_custMaster AND (productHSN 및 productUnit)을 (custAddress 및 custGSTIN)을 선택해야 t_quoteMaster에서 t_quoteMaster의 끝에 붙이십시오 ..
,나는 쿼리 아래 시도했지만 많은 기초로 한 공통의 문제입니다 가입 할 때 경우에 ..SELECT t_quoteMaster.*,
t_productMaster.productHSN,
t_productMaster.productUnit,
t_custMaster.custAddress,
t_custMaster.custGSTIN
FROM t_quoteMaster
INNER JOIN t_productMaster
ON t_quoteMaster.itemName = t_productMaster.productName
INNER JOIN t_custMaster
ON t_quoteMaster.custName = t_custMaster.custName
where t_quoteMaster.quoteNo = '2'
중복 결과를 표시 할 수 있습니까? – Harry
이 예제는 중복을주지 않을 것입니다 ... – kbball
그렇기 때문에 OP가 말하고있는 중복 라인을보고 싶습니다. 중복되는 것을 볼 수 없습니다. – Harry