I am new to writing queries in SQL, and struggling to get the datas from table. 

I have a table called "address" in DB. Here, I have more columns and specifically from two column I need to get the datas filtered out. Both are integers

1. frequency\_type\_id
2. date\_of\_invoice\_id

[![enter image description here](https://i.stack.imgur.com/Xdgoh.jpg)](https://i.stack.imgur.com/Xdgoh.jpg)

I need to get rows only where frequency\_type\_id = 1 and date\_of\_invoice\_id=2, and frequency\_type\_id = 2 and date\_of\_invoice\_id=3, frequency\_type\_id = 3 and date\_of\_invoice\_id=1.

I am trying with the following query, but its not filtering properly,

```
SELECT address_id, company_name,  
invoice_batch_billing, frequency_type_id,  date_of_invoice_id
FROM pls.address where invoice_style='Consolidated' 
and frequency_type_id in 
(SELECT frequency_type_id from  pls.address where frequency_type_id=1 and date_of_invoice_id=1);

```

Hope someone assist.