If you just want customer ids, you may not even need to join with the Customers table. Something like this will giv eyou the customer idsSELECT DISTINCT CustomerIdFROM XWHERE country = 'CA' AND [YEAR] = 2011
If you do need some information that is only in the customers table, for example, first name and last name, one way to do it would be this:SELECT DISTINCT x.CustomerId, c.LastName, c.FirstNameFROM Customers C INNER JOIN X ON x.CustomerId = c.[S#]WHERE x.country = 'CA' AND x.[YEAR] = 2011