View Single Post

   
  #5 (permalink)  
Old 04-29-2008, 08:27 PM
strawberry
 
Posts: n/a
Default Re: how to get three lowest entries per bin

On Apr 27, 3:21 pm, Greg Hennessy <greg.henne...@cox.net> wrote:
> On 2008-04-27, Greg Hennessy <greg.henne...@cox.net> wrote:
>
> > That does seem to get me what I think it should.

>
> That *doesn't* seem to get me what I think it should. I hate typoes.


SELECT t1.* FROM data t1
LEFT JOIN data t2
ON t1.bin = t2.bin
AND t1.flux >= t2.flux
GROUP BY t1.bin,t1.flux
HAVING COUNT(t1.bin) <=3;
Reply With Quote