Skip to content

Instantly share code, notes, and snippets.

@jsauve
Created November 6, 2014 19:03
Show Gist options
  • Save jsauve/d6381ead501a31b85613 to your computer and use it in GitHub Desktop.
Save jsauve/d6381ead501a31b85613 to your computer and use it in GitHub Desktop.
join using spaces and registered trademark symbol: proof of concept
DECLARE @brands TABLE (brand NVARCHAR(50));
INSERT INTO @brands (brand)
VALUES ('BF Goodrich');
SELECT *
FROM dbo.productOwners
INNER JOIN @brands ON
REPLACE(LOWER(brand), ' ', '') = REPLACE(LOWER(productOwner_name), ' ', '') OR
REPLACE(LOWER(productOwner_name), ' ', '') = CONCAT(REPLACE(LOWER(brand), ' ', ''),'®')
@jsauve
Copy link
Author

jsauve commented Nov 6, 2014

Correctly returns a single row when there is an existing row in the dbo.productOwners table with the productOwner_name value set to "BFGoodrich®"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment