Where is the logic in using COUNT(from_date) > 1 in order to count contracts number????
It seems that we have to insert a column of contract_no in the dept_empt so we can solve this task as follows:
SELECT emp_no, count(contract_no) FROM dept_emp WHERE from_date > '2000-01-01'
GROUP BY emp_no
HAVING COUNT(contract_no) > 1
ORDER BY emp_no;
Need your explanation.
thanks
1 answers ( 0 marked as helpful)
Hi Asmaa!
It does not matter which column you will use in the COUNT() function, since all columns have the same length. Actually, the table dept_emp does not have such a column manager_no. This table has 4 columns – emp_no, dept_no, from_date and to_date.
Hope this helps.
Best,
Tsvetelin