title: MSSQL select customers with same products
body: <p>Hello I would like to SELECT the name of the customer who ordered this set of products like the Brazilian customers from Northwind database. I did brazilian products here:</p>
  
  <pre><code>select [ProductName] 
  from [dbo].[Products] join [dbo].[Order Details] on [dbo].[Products].ProductID = [dbo].[Order Details].ProductID
  join [dbo].[Orders] on [dbo].[Order Details].OrderID = [dbo].[Orders].OrderID
  join [dbo].[Customers] on [dbo].[Orders].CustomerID = [dbo].[Customers].CustomerID
  where [Country] = 'Brazil'
  </code></pre>
  
  <p>but what now? How I can find them? I tried to do:</p>
  
  <pre><code>select [CompanyName], [ProductName]
  from [dbo].[Customers] join [dbo].[Orders] on [dbo].[Orders].CustomerID = [dbo].[Customers].CustomerID 
  join [dbo].[Order Details] on [dbo].[Order Details].OrderID = [dbo].[Orders].OrderID
  join [dbo].[Products] on [dbo].[Products].ProductID = [dbo].[Order Details].ProductID
  where  [ProductName] in  (
  select [ProductName] 
  from [dbo].[Products] join [dbo].[Order Details] on [dbo].[Products].ProductID = [dbo].[Order Details].ProductID
  join [dbo].[Orders] on [dbo].[Order Details].OrderID = [dbo].[Orders].OrderID
  join [dbo].[Customers] on [dbo].[Orders].CustomerID = [dbo].[Customers].CustomerID
  where [Country] = 'Brazil')
  </code></pre>
  
  <p>but this also doesn't work :/</p>