I have two tables employee and phone. In phone table there are two type phone no W1 and M that is PHONE_TYPE_CODE.
Now i want records of those employee who does not have any phone number not W1 and M type.
There are 2 records in phone table for each employee with PHONE_TYPE_CODE W1 and M. For any employee if W1 And M type phone_number is null i need those record.
Can you please suggest me what condition i use for that.
|FULL_NAME||6||N||VARCHAR2 (250 Byte)||Height Balanced|
|FIRST_NAME||7||N||VARCHAR2 (20 Byte)||Height Balanced|
|MIDDLE_NAME||8||Y||VARCHAR2 (60 Byte)||None|
|LAST_NAME||9||N||VARCHAR2 (40 Byte)||Height Balanced|
|PHONE_TYPE_CODE||2||N||VARCHAR2 (100 Byte)||Frequency|
|PHONE_NUMBER||3||Y||VARCHAR2 (60 Byte)||Height Balanced|
The data in phone table. In result i don't want 1773,31603. I want just 1779. So can you please suggest me what condition i apply.
First, you are writing into the wrong forum as this one is just for questions on Oracle's SQL Developer tool.
Having that said, you could do something like this:
select person_id from phone where phone_number is null group by person_id having count(distinct phone_Type_code)=2;
Hope that helps,