SQL Script to find differences
Posted on 2015-01-21
I have a mystery to solve and need help creating the script to solve it. This involves lines on a sales order and the field called SHIPCODE.
Sales Order Line Table - SOPLINES
For any one order, the SHIPCODE should always be the same on all lines for the order. What I need to find are the orders where that is not the case. So what I need to find is something like this:
I need it to find order 1010 because at least one of the SHIPCODE is different. How would you structure the query to first identity all the SHIPCODE codes and then if they are all not the same to flag this order?