Posted on 2013-06-06
I have an order table and a line item table that has multiple entries Header and line items, but I only want to retrieve the first occurrence of the order header;
from Orders o
inner join Order_Lines ol on o.ORDER_NUMBER = ol.order_number and ol.PRODUCT_CODE = 'FIELDVALUE'
order by o.bt_id
returns multiple lines for each user, I only want the first occurence