start working on pulling history by part group and data segment
This commit is contained in:
parent
533bbd1046
commit
7a73748b2a
@ -3,14 +3,15 @@
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
DELETE FROM pricing.lastprice;
|
||||
|
||||
WITH srt AS (
|
||||
WITH
|
||||
--------SORT--------
|
||||
srt AS (
|
||||
SELECT
|
||||
customer,
|
||||
mold,
|
||||
part,
|
||||
version,
|
||||
qty,
|
||||
"Customer" customer,
|
||||
"Part Group" partgroup,
|
||||
i.v1ds dataseg,
|
||||
"Data Source" version,
|
||||
"Units" qty,
|
||||
ROUND(sales_usd / qty, 5) AS price,
|
||||
odate,
|
||||
oseas,
|
||||
@ -20,7 +21,10 @@ WITH srt AS (
|
||||
PARTITION BY customer, mold, part, version
|
||||
ORDER BY odate DESC
|
||||
) AS rn
|
||||
FROM rlarp.osm_stack
|
||||
FROM
|
||||
rlarp.osm_stack_pretty o
|
||||
INNER JOIN CMSInterfaceIn.[CMS.CUSLG].ITEMM i ON
|
||||
i.item = o.part
|
||||
WHERE
|
||||
--quotes can't be integrated until we have datasegment or correct part code
|
||||
version IN ('Actual'/*,'Quotes'*/) AND
|
||||
|
Loading…
Reference in New Issue
Block a user