List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:June 14 2001 1:25pm
Subject:Re: HAVING [cond...] problem
View as plain text  
Have you tried:
HAVING
  ( Avg_Xmit < 28800 )
  AND ( Samples >= 10 )

?

Cliff Daniel wrote:

> I'm having some difficulting on 3.23.38, linux x86...  When I write
> the following query the HAVING clause is only listening to the 'AND
> Samples >= 10' and displas all Avg_Xmit regardless if it's less than
> or equal to 28800.
> 
> If I remove the 'AND Samples >= 10' I get the correct results, but of
> course samples are permitted if less than 10, which I do not want.
> 
> Any ideas?
> 
> SELECT  
>         INET_NTOA(NAS_Identifier),
>         NAS_DS1,
>         AVG(Ascend_Xmit_Rate) as Avg_Xmit,
>         AVG(Ascend_Data_Rate) as Avg_Recv,
>         AVG(Acct_Session_Time) / 60 as ACHT,
>         COUNT(*) as Samples
> 
> FROM
>         tbl_data_call_detail
> 
> WHERE   
>         Acct_Session_Time > 0
> 
> GROUP BY
>         NAS_Identifier,
>         NAS_DS1
> 
> HAVING  
>         Avg_Xmit < 28800
> 	AND Samples >= 10
> 
> ORDER BY
>         Avg_Xmit DESC
> 
> 
> Regards,
> Cliff
> 
> 
> ---------------------------------------------------------------------
> 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 <mysql-thread76534@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-- 
Gerald L. Clark
gerald_clark@stripped

Thread
HAVING [cond...] problemCliff Daniel14 Jun
  • Re: HAVING [cond...] problemGerald Clark14 Jun
    • Bugs? Re: HAVING [cond...] problemCliff Daniel14 Jun