|
I am writing a simple query that shows sales orders and corresponding purchase orders joined on the item number. The problem I have is the sales order Item number could have multiple Purchase orders for that item number so i have done a LEFT OUTER JOIN on the item number and that works but the sales order lines are being duplicated and it is confusing the data. So what i get now is. Order|Line|Item|PO No| What i would like is. Thanks in advance.
(comments are locked)
|
|
What is being asked for in terms of a data query is returning the right answer. What you want to 'see' is a presentation issue. To blank out the Order, Line and Item columns, you need to get your presentation layer (application code, report writer, whatever it is you are using to present the data to the user) to handle it. Not saying you couldn't come up with a T-SQL query to do it, just saying it's the wrong place to do it. Agree with suggest and not sure why a Left Join is needed to return the data, an Inner Join would still return the multiple rows. Might be worth OP reading up on http://msdn.microsoft.com/en-us/library/aa213233(v=sql.80).aspx
May 09 '12 at 12:58 PM
Fatherjack ♦♦
(comments are locked)
|

