SQL query-Repost please help

Results 1 to 2 of 2

Thread: SQL query-Repost please help

  1. #1
    Join Date
    Dec 1969

    Default SQL query-Repost please help

    Hi, <BR> I know I have already posted this message in the db forum. Sorry for reposting again. Since this is kinna urgent, I am posting it again.<BR>I have the following query <BR>select emp_id,count(*) <BR>from empDept <BR>group by emp_group_id <BR><BR>I want to pull only records whose group count (count(*) is greater than 2. How do I include that in the query??

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL query-Repost please help

    select emp_id,count(*)<BR>from empDept<BR>having count(*) &#062; 2<BR>group by emp_group_id <BR><BR>That "having" clause may go after the group by... Can never remember.<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts