View Single Post

   
  #6 (permalink)  
Old 03-01-2008, 03:49 PM
Jerry Stuckle
 
Posts: n/a
Default Re: SELECT, GROUP BY & HAVING problem!

Pavel Lepin wrote:
> stockton <simon.stockton@baesystems.com> wrote in
> <cbc1feba-429e-435f-a589-4654ffc0771b@u69g2000hse.googlegroups.com>:
>>> SELECT ID_2, DAY, COUNT(*) AS COUNT, DISTINCT(MONTH) FROM
>>> `TABLE` GROUP BY `ID_2`, `DAY` HAVING COUNT > 1

>> Unfortunately this doesn't work!

>
> Jerry was probably just a bit low on caffeine or something:
>
> SELECT ID_2, DAY, COUNT(DISTINCT MONTH) AS COUNT FROM
> `TABLE` GROUP BY `ID_2`, `DAY` HAVING COUNT > 1;
>
> But really, you should've been able to figure that out
> yourself. That's what the docs are for.
>


No, wrong time of the day. Shouldn't do it shortly before bedtime :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote