Files
lst_v3/backend/prodSql/queries/datamart.bulkOrderArticleInfo.sql
Blake Matthes 47b149d1ea
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 4m26s
feat(dm): migrated all the dm topics
2026-06-26 11:05:17 -05:00

26 lines
636 B
SQL

USE [test1_AlplaPROD2.0_Read]
SELECT
x.HumanReadableId as av
,x.Name
,Alias
,CustomerDescription
,CustomerArticleNumber
,LoadingUnitPieces
,LoadingUnitsPerTruck
,LoadingUnitPieces * LoadingUnitsPerTruck as totalTruckLoad
FROM [masterData].[Article] (nolock) as x
--get the sales price stuff
left join
(select * from (select *
,ROW_NUMBER() OVER (PARTITION BY articleId ORDER BY validAfter DESC) as rn
from [masterData].[SalesPrice] (nolock))as b
where rn = 1) as s on
x.id = s.ArticleId
-- link pkg info
left join
[masterData].[PackagingInstruction] (nolock) as p on
s.PackagingId = p.id
where x.HumanReadableId in ([articles])