Basic SQL question

    Date: 09/09/07 (MySQL Communtiy)    Keywords: sql

    The question from the beginner. Let's assume I have a table of students and classes they take. I know, how to retrieve number of classes for each student. 
            SELECT student COUNT(class) FROM tbl GROUP BY student;

     I need to select all student who take 3 or more classes. What is the SQL syntaxis to say WHERE COUNT > 3? 

    Thank you.

    Source: http://community.livejournal.com/mysql/118761.html

« Identifying duplicate rows... || phpmyAdmin incosistency... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home