Jump to content

[SOLVED] How to work COUNT in a WHERE clause


phpknight

Recommended Posts

Sorry about that.  I'll try to be clearer.  I don't think those examples touched this.  Here is what I want to do.  I know it does not work and probably involves a subquery, but hopefully this will make the issue clear at least.

 

A real world example.  Let's say I wanted to group books by author.  However, I only wanted to see the authors that have written at least ten books. 

 

SELECT *, COUNT(book_ID) FROM table WHERE COUNT(book_ID)>10 GROUP BY author_ID

 

Of course, I can limit the result to 15 or 20 authors, but I cannot figure out how to limit the result to those authors who have only written x books or more.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.