Hi All
I have the query below. If I comment out DISTINCT I get 6446 records. If I include DISTINCT I get 6859 records. ANy ideas how this could be?
TIA,
Sven
select count(*) from
(SELECT
distinct
fcst_signature,
NVL (interim_sku, lowest_sku) sku,
'D' stock_type,
'D' dmd_type,
'C' explosion_type,
'DMST' fcst_type,
CASE
WHEN interim_sku IS NULL
THEN fcst_units_rev * (lowest_revunits + lowest_nonrevunits)
ELSE fcst_units_rev * interim_revunits
END fcst_units_rev,
0 fcst_units_nonrev,
fcst_yr_prd,
NULL fcst_yr_prd_offset,
fcst_horizon_code,
fcst_id
FROM vw_fdm_bom_unexp_fcst_inv_net
WHERE stock_type = 'D'
AND dmd_type = 'I'
AND explosion_type = 'U'
AND fcst_type = 'DMST')
I have the query below. If I comment out DISTINCT I get 6446 records. If I include DISTINCT I get 6859 records. ANy ideas how this could be?
TIA,
Sven
select count(*) from
(SELECT
distinct
fcst_signature,
NVL (interim_sku, lowest_sku) sku,
'D' stock_type,
'D' dmd_type,
'C' explosion_type,
'DMST' fcst_type,
CASE
WHEN interim_sku IS NULL
THEN fcst_units_rev * (lowest_revunits + lowest_nonrevunits)
ELSE fcst_units_rev * interim_revunits
END fcst_units_rev,
0 fcst_units_nonrev,
fcst_yr_prd,
NULL fcst_yr_prd_offset,
fcst_horizon_code,
fcst_id
FROM vw_fdm_bom_unexp_fcst_inv_net
WHERE stock_type = 'D'
AND dmd_type = 'I'
AND explosion_type = 'U'
AND fcst_type = 'DMST')