iam getting the below error while trying to run sql query
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.
but if in the same below query if i put the parameter in upto 10 then its working fine......if the parameter is 11 or above then the query is giving the above error....pls help me
SELECT substring(sc.container_id,0,14) container_id,
imc.item_class,
sh.ship_to, sh.shipment_id,
cust.ADDRESS1,
sh.carrier,
sh.stop_sequence,
sh.company,
sh.order_type
FROM (SELECT max (im.item_class) item_class
FROM shipping_container sc WITH (NOLOCK), item im WITH (NOLOCK)
WHERE sc.item = im.item
AND sc.parent =
(SELECT internal_container_num
FROM shipping_container WITH (NOLOCK)
WHERE sc.container_id = 'RP111027073'
AND internal_shipment_line_num IS NULL)) imc,
shipping_container sc WITH (NOLOCK),
shipment_header sh WITH (NOLOCK),
( select customer, address1, company from dbo.CUSTOMER ) cust
WHERE sc.container_id= 'RP111027073 '
AND sc.internal_shipment_line_num IS NULL
AND sh.internal_shipment_num = sc.internal_shipment_num
and sh.ship_to = cust.customer
and sh.company = cust.company