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
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.
