Select in select [message #13928] |
Tue, 03 August 2004 02:34 |
lokraj
Messages: 1 Registered: August 2004
|
Junior Member |
|
|
I have a Problem
Question
Some countries have populations more than three times that of any of their nieghbours (in the same region). Give the countries and regions.
Table
Cai (name, region, area, population, gdp)
My script is
select name from cia x
where population >= 3(select min population from cia y
where x.region=y.region)
ERROR: parser: parse error at or near "(" at character 48
Please help me.
|
|
|
Re: Select in select [message #13931 is a reply to message #13928] |
Tue, 03 August 2004 04:28 |
kim
Messages: 116 Registered: December 2001
|
Senior Member |
|
|
select name
from cia x
where exists(select 1
from cia y
where x.region = y.region
and x.population >= 3 * y.population)
|
|
|
Re: Select in select [message #390345 is a reply to message #13928] |
Fri, 06 March 2009 01:14 |
alakya
Messages: 3 Registered: March 2009
|
Junior Member |
|
|
i have problem while i am execiting this query
table bbc
(name region population)
Some countries have populations more than three times that of any of their neighbours ... in the same region list the countire
select name,region from bbc x where exists( select name from bbc y
where x.region = y.region and x.population >= 3*y.population);
|
|
|
|
|
Re: Select in select [message #390354 is a reply to message #390352] |
Fri, 06 March 2009 01:28 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Michel Cadot wrote on Fri, 06 March 2009 08:26 | @kim,
More than 100 posts and you still don't know how to post...
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags.
Use the "Preview Message" button to verify.
Regards
Michel
|
Michel,
Over 20000 posts, and still unable to spot the posting date
(just kidding, I couldn't help it)
|
|
|
|
Re: Select in select [message #390358 is a reply to message #13928] |
Fri, 06 March 2009 01:40 |
alakya
Messages: 3 Registered: March 2009
|
Junior Member |
|
|
hi question is
:Some countries have populations more than three times that of any of their neighbours (in the same region). Give the countries and regions.
Table bbc
(Name Region Population)
SELECT NAME,
region
FROM bbc x
WHERE EXISTS (SELECT NAME
FROM bbc y
WHERE x.region = y.region
AND x.population >= 3 * y.population);
can any one helpme....
|
|
|
|
|
Re: Select in select [message #390361 is a reply to message #390360] |
Fri, 06 March 2009 01:55 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Where?
Copy-paste the execution & response from sqlplus here.
Use [code] and [/code]-tags around your code to make it readable when posting it.
|
|
|