SELECT name from SUPPLIER
WHERE code =
(SELECT code FROM STOCK GROUP BY code HAVING COUNT(DISTINCT code)>=3);
I am using SQLPLUS. When the query returns a single result I get the answer I am looking for. However, when it returns more than one row I get this error message:
ORA-01427: single-row subquery returns more than one row
there are two possibilities: one thing is to repair the sub-query so that it would always return only one row, other possibility is to use
INorANY: