Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT
- Item_Table.IItemID AS ItemID AS customer_pk,
- Item_Table.SFullDescription AS FullDescription AS description,
- Category.ICatNodeID AS category,
- Item_Table.SMainBarcode AS MainBarcode,
- Item_Table.BCoreRange AS CoreRange,
- Item_Table.SLabelDescription AS LabelDescription,
- Item_Table.CRetailValue AS RetailValue,
- price.ILocationID AS PriceTypeID,
- price.DTStart,
- price.DTFinish,
- price.BExpired AS Expired,
- price.CSellInc AS SellInc,
- price.DTLastModified
- stk.ILocationID AS LocationID,
- stk.DSoH AS SoH,
- stk.DHoldSoH AS HoldSoH,
- stk.IOnOrder AS OnOrder,
- stk.BStocked AS Stocked,
- stk.ISellMethodID AS SellMethodID,
- stk.DTLastModified,
- stk.ILastModifiedUserID AS LastModifiedUserID,
- stk.ILastModifiedRoleID AS LastModifiedRoleID
- location.SDescription AS LocDescription,
- location.SLocationCode AS LocationCode,
- loc2.ILocationID AS TargetStoreID,
- loc2.SLocationCode AS TargetStore,
- Brand.SDescription AS BrandDescription,
- Manufacturer.ISupplierID AS SupplierID,
- Manufacturer.SSupplierName AS SupplierName
- Merchandise.SDescription AS MerchandiseDescription,
- Range.SDescription AS RangeDescription,
- Range.SRangeCode AS RangeCode,
- SIZE.SDescription AS SizeDescription,
- SubRange.SDescription AS SubRangeDescription,
- Variety.SDescription AS VarietyDescription,
- FROM Item Item_Table
- LEFT JOIN Supplier Manufacturer ON Item_Table.IManufacturerID = Manufacturer.ISupplierID
- LEFT JOIN Def_Item_Brand Brand ON Item_Table.IBrandID = Brand.IBrandID
- LEFT JOIN Def_Item_Variety Variety ON Item_Table.IVarietyID = Variety.IVarietyID
- LEFT JOIN Def_Item_Size SIZE ON Item_Table.ISizeID = SIZE.ISizeID
- LEFT JOIN Def_Item_Range Range ON Item_Table.IRangeID = Range.IRangeID
- LEFT JOIN Def_Item_SubRange SubRange ON Item_Table.ISubRangeID = SubRange.ISubRangeID
- LEFT JOIN Def_Item_Merchandise Merchandise ON Item_Table.IMerchandiseID = Merchandise.IMerchandiseID
- LEFT JOIN Category_Relation Category ON Item_Table.ICatNodeID = Category.ICatNodeID
- LEFT JOIN price price ON Item_Table.IItemID = price.IItemID
- LEFT JOIN Item_Stock stk ON Item_Table.IItemID = stk.IItemID
- INNER JOIN location ON location.ILocationID = price.ILocationID
- INNER JOIN location loc2 ON loc2.ILocationID = stk.ILocationID
- WHERE price.BExpired != 'T'
- ORDER BY price.ILocationID, price.IItemID, price.DTStart;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement