Answer: select * from employee_master
where (dept_no = 20 or dept_no = 50)
and status = 'ÁA';
Suppose,employee_master contains following column and rows:-
Id Name Address Dept_No Status
1 Vishal Pune 10 AA
2 Neeraj NULL 20 DD
3 Nitin Nagpur 30 AA
4 Rajesh Jodhpur 20 AA
5 Pooja Nagpur 50 AA
6 Praveen Bhilai 20 AA
7 Vinod NULL 50 DD
Here,Status ='AA' means active employee and 'DD' means De-active employees.
And if i fire above query,then i will get below output as:-
Id Name Address Dept_No Status
4 Rajesh Jodhpur 20 AA
5 Pooja Nagpur 50 AA
6 Praveen Bhilai 20 AA
Asked In: Many Interviews |
Alert Moderator