Question : Getting first instance as result

I have the following SQL Query and the results will come back with multiple rows as the same PROD may be in different warehouses. However, I only want to show one row and if I isolate it to one warehouse, I may miss one that is in another warehouse but not in the warehouse I choose.

SELECT PROD
      ,VENDOR1_NAME
      ,VENDOR2_NAME

FROM IM

WHERE VENDOR1_NO='177'

Is there a way for me to write the statement and only get back one row per PROD regardless of warehouse?

Thank you

Answer : Getting first instance as result

what about?

SELECT PROD
     ,max(VENDOR1_NAME)
     ,max(VENDOR2_NAME)

FROM IM

WHERE VENDOR1_NO='177'

group by prod

Random Solutions  
 
programming4us programming4us