I know this is probably a stupid question, but
Im beginning to have to deal with more databases that are not oracle, so Im trying to learn to use ansi sql statements. In Oracle, I would normally do a select like this to get a list of all employees and their phones including employees who dont have an active phone.
select name, phone from emps, phones where
emps.emp_id = phones.emp_id (+)
and phones.active_flag(+)='Y'
How can I replicate that with an ansi style select? How can i get the outer join on phones.active_flag(+) = 'Y'?
I can do:
select name, phone
from emps
right outer join phones on (emps.emp_id=phones.emp_id)
where emps.active_flag = 'Y' and phones.active_flag='Y'
but that wont give me the emps who do not have active phones.
Im beginning to have to deal with more databases that are not oracle, so Im trying to learn to use ansi sql statements. In Oracle, I would normally do a select like this to get a list of all employees and their phones including employees who dont have an active phone.
select name, phone from emps, phones where
emps.emp_id = phones.emp_id (+)
and phones.active_flag(+)='Y'
How can I replicate that with an ansi style select? How can i get the outer join on phones.active_flag(+) = 'Y'?
I can do:
select name, phone
from emps
right outer join phones on (emps.emp_id=phones.emp_id)
where emps.active_flag = 'Y' and phones.active_flag='Y'
but that wont give me the emps who do not have active phones.