Here's a conundrum I'm having with MySQL.

The following code returns a bunch of records:

SELECT sl_Year,
       sl_DayOfYear,
       sl_Query,
       SUM(sl_CountOfOccurrences) AS NumRequests
FROM SearchLog
GROUP BY sl_Year,
         sl_DayOfYear,
         sl_Query

one of these records looks like (there are more, but this serves as an
example):

2001      305       'vru'       8

If I then use the following SQL:

SELECT sl_Year,
       sl_DayOfYear,
       sl_Query,
       SUM(sl_CountOfOccurrences) AS NumRequests
FROM SearchLog
GROUP BY sl_Year,
         sl_DayOfYear,
         sl_Query
HAVING NumRequests > 3

I get ZERO records returned.  As an alternate, I also tried:

SELECT sl_Year,
       sl_DayOfYear,
       sl_Query,
       SUM(sl_CountOfOccurrences) AS NumRequests
FROM SearchLog
GROUP BY sl_Year,
         sl_DayOfYear,
         sl_Query
HAVING SUM(sl_CountOfOccurrences) > 3

and that also returned ZERO records.

Has anyone else encountered this problem?



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to