RE: How to do this Query
Posted in 1997
select count(*) num_of_emp, dept_id
from emp_table
group by detp_id
having count(*) = 1 *or count(*) = N
} -----Original Message-----
} From: S.Sathish [SMTP:ssathish@getafix.cmc.net.in]
} Sent: Tuesday, October 28, 1997 2:56 AM
} To: informix-list@rmy.emory.edu
} Subject: How to do this Query
}
}
} Hi,
} Table : Dept_id Emp_id
}
} I want the dept_id which has Nth maximum number of employees.
}
} Eg: 1st maximum no of employees ie,..,the dept_id which has the max no
} of employees.
} 2nd max no of employees ie,..,the dept_id which is second in the
} list of no of employees in a dept
}
} ..........
}
} So, i want a general method for the Nth case.
}
} **********************************************************************
} ********
} S.Sathish
} email :ssathish@cmcbang.ernet.in
} **********************************************************************
} ********
}