I have 2 tables
CREATE TABLE [dbo].[Policy](
[PolicyID] [int] IDENTITY(1,1) NOT NULL,
CREATE TABLE [dbo].[PolicyDetails](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PolicyID] INT NULL,
[CustomerID] INT NULL
I need to return all customers that have policies in both companyids 45 and 87. There are many companies but only 45 and 87 are relevant. If a customer has a policy under only one company it's not relevant.
How would I do that?