hello guys i was create a new system on database sql then i get this is error
Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows
=, !=, <, <= , >, >= or when the subquery is used as an expression.
here is a query
Declare @Weapon INT = (Select ItemID From SRO_VT_SHARD.dbo._Inventory WITH (Nolock) Where CharID = @CharID
AND Slot in (Select Slot From SRO_VT_SHARD.dbo._Inventory Where CharID = @CharID And Slot Between '6' And '7'))
Declare @WeaponType3 Tinyint =
(Select Typeid3 from SRO_VT_SHARD.dbo._RefObjCommon where ID in
(Select RefItemID from SRO_VT_SHARD.dbo._Items where ID64=@Weapon))
Declare @WeaponType4 Tinyint =
(Select Typeid4 from SRO_VT_SHARD.dbo._RefObjCommon where ID =
(Select RefItemID from SRO_VT_SHARD.dbo._Items where ID64=@Weapon))
declare @RefWeapon int = (Select top 1 ID from SRO_VT_SHARD.dbo._RefObjCommon WITH (Nolock) where
Service = 1 AND
TypeID1=3 AND --- Weapon
TypeID2=1 AND
TypeID3=@WeaponType3 AND
TypeID4=@WeaponType4
Group by SRO_VT_SHARD.dbo._RefObjCommon.ID,SRO_VT_SHARD.dbo._RefObjCommon.reqlevel1
having (MAX(ReqLevel1)<=(Select CurLevel from SRO_VT_SHARD.dbo._Char where charid = @CharID))
Order By ReqLevel1 Desc
)
if (@RefWeapon is not null) And (@Weapon is not null) And (@WeaponType3 is not null) And (@WeaponType4 is not null)
begin
Update SRO_VT_SHARD.dbo._Items set RefItemID= @refweapon where ID64= @Weapon
end
i need fix for this is query