creat elist of active parts with descriptions
This commit is contained in:
parent
4108c02beb
commit
b6464e51b9
23
route_sql/part_list.sql
Normal file
23
route_sql/part_list.sql
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
WITH
|
||||||
|
act As (
|
||||||
|
SELECT DISTINCT
|
||||||
|
v6part part
|
||||||
|
FROM
|
||||||
|
lgdat.stka
|
||||||
|
WHERE
|
||||||
|
v6stat = 'A'
|
||||||
|
)
|
||||||
|
,stkm AS (
|
||||||
|
SELECT
|
||||||
|
act.part || ' - ' ||rtrim(COALESCE(m.avdes1,p.awdes1)) part
|
||||||
|
--,COALESCE(m.avgled, p.awgled) glec
|
||||||
|
FROM
|
||||||
|
act
|
||||||
|
LEFT OUTER JOIN lgdat.stkmm m ON
|
||||||
|
m.avpart = act.part
|
||||||
|
LEFT OUTER JOIN lgdat.stkmp p ON
|
||||||
|
p.awpart = act.part
|
||||||
|
WHERE
|
||||||
|
substr(COALESCE(m.avgled, p.awgled),1,1) <= '2'
|
||||||
|
)
|
||||||
|
select part from stkm
|
Loading…
Reference in New Issue
Block a user