filter out low grade matches

This commit is contained in:
Trowbridge 2020-03-04 17:13:36 -05:00
parent 3492c802b9
commit 28865863bd

View File

@ -1,5 +1,5 @@
WITH WITH
target AS (select replace_new_mold new_mold) target AS (select 'replace_new_mold' new_mold)
,basemix AS ( ,basemix AS (
SELECT SELECT
part, part,
@ -47,7 +47,13 @@ target AS (select replace_new_mold new_mold)
FROM FROM
basemix b basemix b
LEFT OUTER JOIN rlarp.itemmv i ON LEFT OUTER JOIN rlarp.itemmv i ON
i.stlc = (SELECT new_mold FROM target) i.stlc = (SELECT new_mold FROM target WHERE new_mold <> '')
AND CASE WHEN b.sizc = i.sizc THEN '1' ELSE '0' END||
CASE WHEN i.aplnt = 'I' THEN '0' ELSE '1' END||
CASE WHEN b.colgrp = i.colgrp THEN '1' ELSE '0' END||
CASE WHEN b.coltier = i.coltier THEN '1' ELSE '0' END||
CASE WHEN b.colc = i.colc THEN '1' ELSE '0' END||
CASE WHEN substring(b.part,9,12) = substring(i.item,9,12) THEN '1' ELSE 0 END >= '111110'
) )
--SELECT * FROM tag --SELECT * FROM tag
,rsort AS ( ,rsort AS (