Say I have a table with empId and First_name column with the following data:
EmpID First_Name
===================
10 Jack
20 Harry
So suppose I write this query as
select count(1), empId from Employees
where empId = 50
group by empId;
This will give an error.
I want the count and empId to be displayed as 0 in case there is no matching data. How can I achieve the same?
EDIT
I actually need the empId and the count, using the first_name...like this way:
select count(1), empId from Employees
where First_Name= 'edward'
group by empId;
So in this case, count should be 0, and empId as null.
Message was edited by: adfSonal