Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> sql help - group by with subselect
Does anyone know why I can't use the country or state in the group by?
SQL>
select airport_cd,
(select country.name from country where country_id=airport.country_id) as
country,
(select state.name from state where state_id=airport.state_id) as state,
city
from airport,
group by airport_cd, country, state
order by airport_cd
;
group by vendor.name, airport_cd, country, state
*ERROR at line 9: