On 12/9/08, Christophe Leske <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  can someone point me to some docs where the difference between a normal
>  "where"-clause and the "Group by", and "having" statements are being
>  explained?
>

Think of HAVING as being analogous to WHERE. While WHERE applies to
the TABLE, HAVING applies to the results of GROUP. Here is a contrived
example

SELECT foo, Count(foo) AS count_of_foo
FROM TABLE
WHERE foo LIKE 'C%'
GROUP BY foo
HAVING count_of_foo > 1

The above will take all rows where 'foo' starts with 'C', sum the
value of each distinct 'foo', and then show only those that are more
than 1


>  I donĀ“t quite understand what these are actually good for.
>
>  Thanks,
>
>  --
>  Christophe Leske
>
>  www.multimedial.de - [EMAIL PROTECTED]
>  http://www.linkedin.com/in/multimedial
>  Lessingstr. 5 - 40227 Duesseldorf - Germany
>  0211 261 32 12 - 0177 249 70 31
>
>
>  _______________________________________________
>  sqlite-users mailing list
>  sqlite-users@sqlite.org
>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Puneet Kishor
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to