I can't suppress details or my totals will be wrong.
I don't know how to do or what a stored procedure is.
I can create a view of the table but I still need the SQL statement to do that.
I don't know how Distinct can help me. I don't want every distinct combination.
There can be multiple Cust_Order_ID to any given WorkOrder_Base_ID There can be multiple WorkOrder_Base_ID to any given Cust_Order_ID
in addition the Cust_Order_ID could be NULL.
I don't care which Cust_Order_ID the results return, as long as it only returns one Cust_Order_ID per WorkOrder_Base_ID and Cust_Order_ID isn't NULL
Example:
ROW WO CO row1...123.................AAA row2...123.................BBB row3...123.................AAA row4...456.................AAA row5...456.................CCC row6...456.................<NULL>
I want my results to return only (1) of Rows 1, 2, 3 -don't care which and only (1) of Rows 4, 5 -don't care which but NEVER Row 6
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 04 Nov 2009 at 6:36am
if you are using the aggregate functions, like sum, average, or count, suppressing details will not affect them.
It would look like you only want the header or the footer of a group based on WO. A header will give you the row1 and footer will give row3 in the above example.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum