I have this sql table and rows defined in SQL Fiddle
The SUPPLIER_DETAILS table has a field named IS_PAYABLE that will be either null or "Y".
If IS_PAYABLE='Y', for each PRODUCT_REG there can be one or more records with different PRODUCT_NO . For instance. PRODUCT_REG = 'HP_C20'has two entries with IS_PAYABLE='Y'.
HP_C20 FR-A GB-A128 Y
HP_C20 FR-A GB-A098 Y
What I would like to have is if IS_PAYABLE='Y', and if for one PRODUCT_REG there are several records, then I would like only one of the records, and I need all the records with IS_PAYABLE is null.
How can i achieve this? If I do not make my requirement clear, I will explain further.
Any help is very noticeable.
thank
source
share