I have a query, I need to get a row only if all the ID match in WHERE clause
Here is the query
SELECT CompanyId
FROM vendors
WHERE VendorId
IN (
'306145244', '1011073437'
)
I want all the CompanyId
which has both vendorId
'306145244' and '1011073437'
If one of the VendorId
match, I don't want that companyId
. Both VendorId should be matched
While grouping I need 2 rows like below
company Id Vendor Id
1 306145244
1 1011073437
2 306145244
2 306145244
If possible I want this query in ORACLE
.