I have a query here: For each country in "America", give the highest mountain and its height; ordered by height. and tables:
encompasses : country,continent
i wrote so:
select co.country,mo.name, max(mo.height) as mheight
from mountain mo
cross join encompasses co
join geo_mountain gmo
where gmo.country=any (select country from encompasses where continent='America') and co.continent='America'
GROUP BY co.country,mo.name
order by mheight;
but i get a lot of results, please rewrite my query if possible
im using oracle 11g, ubintu 12.4
thank you so much
One of the things you will find, after you move from School to an IT department, is that your questions themselves will be questioned. For example, does the query give you an error, or is it just returning the wrong results? Your title says one thing, and the body implies another.
Hi thank u
no error, just a lot of results ,as i said it shouldn't be a lot
yes i now but when i change " cross join encompasses co" to "join geo_mountain gmo ,encompasses co" i get error and i think it also wont be correct.