How to solve this subquery error?
Can you please tell me whats wrong with this? It throws error
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
And whats meant by using({?SUB_ALLOC_PARM}))
I guess its parameter value right?
select distinct LFS_LFS as DN
, LFS_VONNR
, LZL_REFNR
, AGR_TEXT
, LFS_KNR as Store
, LFS_DATOK
, FIL_INDEX as Store_name
, LAN_TEXT as COUNTRY
, LZL_MENGE as Qty
, ANS_NAME1 AS 'Customer Name'
, ANS_NAME2 AS 'Customer Address line 1'
, ANS_STRASSE AS 'Customer Address line 2'
, ANS_STRASSE_2 AS 'Customer Address line 3'
, ANS_ORT AS 'City'
, ANS_TITEL AS 'State'
, LAN_TEXT AS 'Country'
, ANS_PLZ AS 'PostCode'
, ( select FIL_NUMMER
from FUTURA..V_FILIALEN as HO
where HO.FIL_LAND = STORE.FIL_LAND
and HO.FIL_MANDANT = 1
and HO.FIL_ART = 0
) as HO_BRANCH
from FUTURA..V_LIEFHEAD,
FUTURA..V_ARTIKEL,
FUTURA..V_ART_KOPF,
FUTURA..V_LIEFZEIL,
FUTURA..V_LAGER as BR5,
FUTURA..V_FILIALEN as STORE,
FUTURA..V_ANSCHRIF,
FUTURA..V_LAND
where AGR_MANDANT = ART_MANDANT
and AGR_WARENGR = ART_WARENGR
and AGR_ABTEILUNG = ART_ABTEILUNG
and AGR_TYPE = ART_TYPE
and AGR_GRPNUMMER = ART_GRPNUMMER
and LZL_REFNR = ART_REFNUMMER
and ART_MANDANT = LFS_MANDANT
and LFS_LFS = LZL_LFS and LFS_MANDANT = LZL_MANDANT
and LFS_MANDANT = 1
and LZL_REFNR <> 开发者_JS百科0
and LZL_REFNR = BR5.LAG_REFNUMMER
and LZL_MANDANT = BR5.LAG_MANDANT
and BR5.LAG_MANDANT = 1
and BR5.LAG_FILIALE = LFS_VONNR
and FIL_MANDANT = LZL_MANDANT
and FIL_NUMMER = LFS_KNR
and LAN_MANDANT = FIL_MANDANT
and LAN_NUMMER = FIL_LAND
AND ANS_TYP = 2 -- branches
AND ANS_COUNT = 1 -- sequence 1
AND ANS_MANDANT = FIL_MANDANT
AND ANS_NUMMER = FIL_NUMMER
and LFS_LFS IN (
select distinct PVG_LIEFERSCHEIN
from FUTURA..V_PVERFIL
where PVG_NUMMER IN ({?SUB_ALLOC_PARM})
)
order by
LFS_KNR
Most likely, your
select FIL_NUMMER
from FUTURA..V_FILIALEN as HO
where HO.FIL_LAND = STORE.FIL_LAND
and HO.FIL_MANDANT = 1
and HO.FIL_ART = 0
clause is returning more than one value.
精彩评论