Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Can you create bimodal joins?

Re: Can you create bimodal joins?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Sun, 13 May 2001 00:24:41 -0700
Message-ID: <3AFE36B9.979198E2@exesolutions.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US