Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Subconsulta com erro de identificador inválido no sql


Você precisa mover suas condições de junção dentro da subconsulta
SELECT tour_date AS "Departure Date",  site_name "Site Name"
FROM (
    SELECT res_id,tour_date,site_name, (res_partcost +NVL(RES_GEARCOST,0)) as "total_cost" 
    FROM reservation,site,tour
    WHERE reservation.tour_id = tour.tour_id
    AND tour.site_id = site.site_id ) Res1
WHERE Res1.total_cost > 230 // this will not be displayed in a result
GROUP BY tour_date, site_name;