I have select query that fetch record based on a condition
Select * from Employee where EmpStatus=#EmpStatus#
The EmpStatus in the DB for each employee would either 0 or 1.
EmpID EmpName EmpStatus
***********************
1 Name1 0
2 Name2 0
3 Name4 1
4 Name5 1
When I pass EmpStatus as 1, I should get list containing ONLY 3 and 4. But if i pass EmpStatus as 0, ALL the 4 records should be fetched. How can this be done with a single optimal select query?