select distinct for 2 code example
Example: select distinct on 2 columns
SELECT agent_code, ord_amount, cust_code, ord_num
FROM orders
WHERE agent_code='A002';
SELECT agent_code, ord_amount, cust_code, ord_num
FROM orders
WHERE agent_code='A002';