Answer the question
In order to leave comments, you need to log in
Oracle: why is there an error?
Hello,
in general, there is such a request:
SELECT S.cost
FROM(
(
SELECT shoppingserviceid ,cost,bsid
FROM service JOIN shopping_service
ON service.serviceid = shopping_service.serviceid
) S JOIN provided_service
ON provided_service.shoppingserviceid = S.shoppingserviceid
) P JOIN provide_service_detail
ON provide_service_detail.providedserviceid = P.providedserviceid
Answer the question
In order to leave comments, you need to log in
It’s hard to understand something here, use named queries, everything will fall into place.
WITH query_name AS (subquery)
I did it like this and it works:
SELECT *
FROM service
JOIN shopping_service
ON service.serviceid = shopping_service.serviceid
JOIN provided_service
ON provided_service.shoppingserviceid = shopping_service.shoppingserviceid
JOIN provide_service_detail
ON provide_service_detail.providedserviceid = provided_service.providedserviceid
1. S.cost - not visible at the top level
2. The condition provide_service_detail.providedserviceid = P.providedserviceid will not work
3. You need to rewrite something like this
SELECT S.cost
FROM (select * from ((SELECT shoppingserviceid, cost, bsid FROM service JOIN shopping_service ON service.serviceid = shopping_service.serviceid) S JOIN
provided_service ON provided_service.shoppingserviceid = S.shoppingserviceid)) P
JOIN provide_service_detail
ON provide_service_detail.providedserviceid = P.providedserviceid
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question