sql code left outer join

sql code left outer join

am 21.11.2005 15:33:10 von raj

Hi, I'm trying to left outer join two tables onto one. For some reason the
table is losing some of the left table data (vw_standard_costing_items).
Please can you tell me why, and a fix please?



I'm left outer joining

vw_standard_costing_budgeted_amount

and

vw_standard_costing_purchase_price

onto

vw_standard_costing_items




Thanks,

Raj (Newbie)



SELECT dbo.vw_standard_costing_items.No_,
dbo.vw_standard_costing_items.[Safety Stock Quantity],

dbo.vw_standard_costing_items.[Gen_ Prod_ Posting
Group], dbo.vw_standard_costing_items.Form,
dbo.vw_standard_costing_items.Description,

dbo.vw_standard_costing_items.[Description 2],
dbo.vw_standard_costing_items.[Vendor No_],
dbo.vw_standard_costing_budgeted_amount.Name,

dbo.vw_standard_costing_budgeted_amount.[Budgeted
Amount], dbo.vw_standard_costing_items.[Minimum Order Quantity],

dbo.vw_standard_costing_purchase_price.[Currency Code],
dbo.vw_standard_costing_purchase_price.[Direct Unit Cost],

dbo.vw_standard_costing_purchase_price.[Starting Date],
dbo.vw_standard_costing_purchase_price.[Ending Date],

dbo.vw_standard_costing_purchase_price.[Unit of Measure
Code]

FROM dbo.vw_standard_costing_items LEFT OUTER JOIN

dbo.vw_standard_costing_budgeted_amount ON

dbo.vw_standard_costing_items.[Vendor No_] =
dbo.vw_standard_costing_budgeted_amount.No_ LEFT OUTER JOIN

dbo.vw_standard_costing_purchase_price ON

dbo.vw_standard_costing_items.[Vendor No_] =
dbo.vw_standard_costing_purchase_price.[Vendor No_] AND

dbo.vw_standard_costing_items.No_ =
dbo.vw_standard_costing_purchase_price.[Item No_]

Re: sql code left outer join

am 21.11.2005 18:01:04 von Hilarion

> Hi, I'm trying to left outer join two tables onto one. For some reason the
> table is losing some of the left table data (vw_standard_costing_items).
> Please can you tell me why, and a fix please?
>
> [snip]


Why did you post to "alt.php.sql"? Does the select statement work OK
in some external application and does not work OK in PHP?
Why did you post to so many different "microsoft.public.sqlserver.*"
groups? "microsoft.public.sqlserver.programming" should be
enough.

What data from "vw_standard_costing_items" is missing from the
output?


Hilarion