Help with WHERE clause

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • javindran
    New Member
    • Apr 2013
    • 2

    Help with WHERE clause

    Basically, I need to find the department which consists more than 10 staffs as I am stuck.

    Code:
    SELECT dname, sid
    FROM dept INNER JOIN staff ON dept.did = staff.did
    WHERE ?????? (this is the part where I am stuck)
    Any SQL will be helpful.
    I will frequently monitor this question to reply to ur answers and questions if u need it.
    Thanks in advance.
    Last edited by Niheel; Apr 2 '13, 07:20 PM. Reason: Please use code tags when posting code.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    You need to use COUNT first to get the total staff then use having as explained by examples here http://www.w3schools.com/sql/sql_having.asp

    Comment

    • javindran
      New Member
      • Apr 2013
      • 2

      #3
      still stuck, can u give an example on count

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Did you read the link I posted above?

        Comment

        Working...