
I want to select all dealercode (distinct) and introducercode with iapn. Bbut iapn must be a highest value only.
e.g.
dealercode = 7 and iapin = 3 and introducercode = 3
like that (THIS MUST BE A ONLY VALUE FOR DEALERCODE)
This is my query:
SELECT DISTINCT
dealercode, iapin as iapin,
(SELECT introducercode) as introducecode
FROM
dealerplacement d
where
exists (SELECT MIN(iapin) FROM dealerplacement )
ORDER BY
dealercode, iapin ASC
I have attached with this post data set to this code.

This is the structure. I want to get result as below. DEALERCODE 1200 iapn 003 and introducercode 203. only.
current database as below.
1200 001 201
1200 002 202
1200 003 203
Please help me to solve this.