Select zlicza dokumenty logistyczne w systemie:
SELECT 'BO - OPM' AS Typ, COUNT(*)
FROM ic_tran_cmp_vw1 a
WHERE a.REASON_CODE LIKE 'BO'
AND a.co_CODE = 'ORG'
UNION
SELECT 'RW - OPM' AS Typ, COUNT(*)
FROM ic_tran_cmp_vw1 a
WHERE a.doc_type IN ('ADJI', 'ADJR')
AND a.REASON_CODE LIKE 'R%'
AND a.co_CODE = 'ORG'
UNION
SELECT 'PW - OPM', COUNT(*)
FROM ic_tran_cmp_vw1 a
WHERE a.doc_type IN ('CRER', 'CREI')
AND a.REASON_CODE LIKE 'PW%'
AND a.co_CODE = 'ORG'
UNION
SELECT 'WZ-OPM', COUNT(*)
FROM ic_tran_cmp_vw1 a
WHERE a.doc_type IN ('OMSO')
AND a.co_CODE = 'ORG'
UNION
SELECT 'PZ-OPM', COUNT(*)
FROM ic_tran_cmp_vw1 a
WHERE a.doc_type IN ('PORC')
AND a.co_CODE = 'ORG'
UNION
SELECT 'ZZ', COUNT(*)
FROM PO_HEADERS_ALL
WHERE org_id = '106'
UNION
SELECT 'ZS', COUNT(*)
FROM OE_ORDER_HEADERS_ALL
WHERE org_id = '106'
UNION
SELECT 'KONTRAKT', COUNT(*)
FROM oe_blanket_headers_ALL
WHERE org_id = '106'
UNION
SELECT 'ZAPOTRZEBOWANIA', COUNT(*)
FROM PO_REQUISITION_HEADERS_ALL
WHERE org_id = '106'
UNION
mts.transaction_source_type_name,
COUNT(mtl.transaction_id)
FROM mtl_material_transactions mtl, mtl_txn_source_types mts
WHERE mtl.transaction_source_type_id = mts.transaction_source_type_id
AND mtl.organization_id = '106'
GROUP BY transaction_source_type_name; |
select 'BO - OPM' as Typ, count(*)
from ic_tran_cmp_vw1 a
where a.REASON_CODE LIKE 'BO'
and a.co_CODE = 'ORG'
UNION
select 'RW - OPM' as Typ, count(*)
from ic_tran_cmp_vw1 a
where a.doc_type in ('ADJI', 'ADJR')
and a.REASON_CODE LIKE 'R%'
and a.co_CODE = 'ORG'
UNION
select 'PW - OPM', count(*)
from ic_tran_cmp_vw1 a
where a.doc_type in ('CRER', 'CREI')
and a.REASON_CODE LIKE 'PW%'
and a.co_CODE = 'ORG'
UNION
select 'WZ-OPM', count(*)
from ic_tran_cmp_vw1 a
where a.doc_type in ('OMSO')
and a.co_CODE = 'ORG'
UNION
select 'PZ-OPM', count(*)
from ic_tran_cmp_vw1 a
where a.doc_type in ('PORC')
and a.co_CODE = 'ORG'
UNION
SELECT 'ZZ', COUNT(*)
FROM PO_HEADERS_ALL
where org_id = '106'
UNION
SELECT 'ZS', COUNT(*)
FROM OE_ORDER_HEADERS_ALL
where org_id = '106'
UNION
SELECT 'KONTRAKT', COUNT(*)
FROM oe_blanket_headers_ALL
where org_id = '106'
UNION
SELECT 'ZAPOTRZEBOWANIA', COUNT(*)
FROM PO_REQUISITION_HEADERS_ALL
where org_id = '106'
union
mts.transaction_source_type_name,
count(mtl.transaction_id)
from mtl_material_transactions mtl, mtl_txn_source_types mts
where mtl.transaction_source_type_id = mts.transaction_source_type_id
and mtl.organization_id = '106'
group by transaction_source_type_name;
Ten wpis został opublikowany w kategorii
INV - ODM,
INV - OPM,
SQL-ki i oznaczony tagami
kolory,
wygląd. Dodaj zakładkę do
bezpośredniego odnośnika.