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

Home -> Community -> Usenet -> c.d.o.misc -> SQL Count/Max question

SQL Count/Max question

From: Daniel Lidström <daniel.lidstrom_at__DELETE_home.se>
Date: Wed, 12 Feb 2003 16:42:02 +0100
Message-ID: <b2dq82$d7f$1@news.solace.mh.se>


Hello,

I have the following result from a query, say LM:

Date Code

2003-01-01    BL
2003-01-01    BL
2003-01-01    BL
2003-01-01    BL
2003-01-01    BL
2003-01-01    IM
2003-01-01    IM
2003-01-09    AA
2003-01-09    AA

How do I find the Code which occurs the most times for a single date? In this case it is BL which occurs 5 times for a single date. It is possible that codes occur for more than one date, although there are none in this example. What I would like to see in the result is:

Code Number
BL 5

How would I do this? Any hints/code samples greatly appreciated. Thanks!

--

Daniel Lidström

62 23' 25" N
17 15' 31" E
Received on Wed Feb 12 2003 - 09:42:02 CST

Original text of this message

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