I am trying to connect 2 tables in mysql
. But, I am getting duplicate values. This SQLFIDDLE will clear what I meant to say.
In result, you can see the TW_ID
and PFC_ID
. I just need (1, 1), (11, 11), (21, 21)
and so on.. Right now I am getting (1, 1), (1, 11), (1, 21), ...
I am using this query:
SELECT tw.id as tw_id, pfc.id as pfc_id
FROM account_treasury_wholesale tw
INNER JOIN purchase_foreign_currency pfc
ON tw.wholesaler_id = pfc.currency_supplier_id
WHERE tw.wholesaler_id='11'
Let me know, if you need more clarification. Thanks.