Reputation: 55
My request sounds like this: Display sellers and buyers in your city with a rating of more than 100.
SELECT *
FROM Sal outer
WHERE EXISTS (SELECT * FROM Cust inner WHERE outer.snum = inner.snum AND rating > 100);
But according to the task I need to parallelize it, tell me how to do it? I tried this option, but it doesn't work
SELECT /*+ FULL(hr_emp) PARALLEL(hr_emp, 2) */ SNUM
FROM Sal outer hr_emp;
WHERE EXISTS (SELECT * FROM Cust inner WHERE outer.snum = inner.snum AND rating > 100);
Upvotes: 0
Views: 412
Reputation: 142705
Parallel hint is described in documentation.
full (hr_emp)
hint? Where did hr_emp
come from and what does it have to do with your case?outer
? Sounds like outer join
, but you used it as a table alias in the 1st select
you posted, while its usage in the 2nd is completely invalid.It would probably help if you posted sample data (create table
and insert into
statements) as well as desired output, as it is quite difficult to guess what you really have.
After you edited the question, then your query might look like this:
select /*+ parallel (2) */
c.cnum, c.cname, c.rating, s.sname
from cust c join sal s on s.snum = c.snum
where c.rating > 100;
Upvotes: 3