feat(opendock): scheduing updates
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m39s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m39s
ref #23
This commit is contained in:
34
backend/prodSql/queries/opendock.addressLink.sql
Normal file
34
backend/prodSql/queries/opendock.addressLink.sql
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
This will return all address with a sales price.
|
||||
*/
|
||||
WITH ranked AS (
|
||||
SELECT
|
||||
av.id,
|
||||
av.humanReadableId as av,
|
||||
av.Alias as description,
|
||||
-- CONCAT(ad.HumanReadableId, ' - ',ad.Name) as customer ,
|
||||
ad.HumanReadableId as customer,
|
||||
ad.Name as customerDescription,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY AddressId, sp.articleId
|
||||
ORDER BY ValidAfter DESC
|
||||
) AS rn
|
||||
FROM [test1_AlplaPROD2.0_Read].[masterData].[SalesPrice] as sp (nolock)
|
||||
|
||||
/* av */
|
||||
left join
|
||||
[test1_AlplaPROD2.0_Read].[masterData].[Article] as av (nolock) on
|
||||
av.id = sp.articleId
|
||||
|
||||
/* address */
|
||||
left join
|
||||
[test1_AlplaPROD2.0_Read].[masterData].[Address] as ad (nolock) on
|
||||
ad.id = AddressId
|
||||
|
||||
)
|
||||
SELECT *
|
||||
FROM ranked
|
||||
WHERE rn = 1
|
||||
and ranked.av = '[articleCheck]'
|
||||
|
||||
order by customerDescription
|
||||
Reference in New Issue
Block a user