Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Can you create bimodal joins?
Bill Kincaid wrote:
> Am having a problem determining a method of creating a query producing a
> bimodal join.
> Example:
>
> Take a table with 15 temperatures of cities around the world from the CITIES
> table.
>
> CITIES table
> City A30
> Temp N
>
> New York 12
> Atlanta 57
> Philadelphia 25
> San Francisco 53
> Los Angeles 57
> San Diego 55
> Mexico City 35
> Lima 35
> Quebec 22
> Birmingham 57
> London 40
> Portland 47
> Seattle 49
> Chicago 35
> Phoenix 57
>
> You can see that the bimodal results in 4 examples of 57 and 3 of 35.
> How do I create a SQL query which will produce this result?
>
> Thanks
> Bill Kincaid
> BillKincaid_at_mindspring.com
SELECT city, result
FROM
(SELECT city, temp, COUNT(*) RESULT
FROM cities
GROUP BY city, temp);
is one solution.
Daniel A. Morgan Received on Sun May 13 2001 - 02:24:41 CDT
![]() |
![]() |