SQL: How do you return a record in a conditional statement and return a null value if false? -
I am trying to return the records of people living in Baton Rouge, Connecticut. If any person is also an employee, then his work center ID is also displayed. Otherwise, a zero value is returned. I am using the staff of staff and the person I am stuck, what is the case statement is where I am trying to return the workstation ID if any person employee (if he has an employee ID), otherwise, a vacuum Value should print. I'm not sure how it can reach a record, if it satisfies the condition or when the situation is not in existence, then can print zero value. I have seen the Oracle i-learning slides and the slides of my teacher and how I did not know how I am using Oracle SQL. try it
SELECT last_name, first_name, birth_date, city, State, employee_id, work_center_id, case when employee_id is not working, then work_central_id as ELSE faucet end, where the employee is from upper ('Bethany') and state = 'Connecticut' employee AISC;
Comments
Post a Comment