Q:

How can I group by misspelled records in SQL

I'm looking for advice on how to tackle the issue of different spelling for the same name. I have a SQL Server database with job positions, and there are some names that are the same but the spelling is different. While using distinct getting like below but all are same position
For example:

Former Employee - SBM (Student Brand Manager)
Former Employee - SBM
Former Employee - Student Brand Manager
Former Employee - Student Brand Manager (SBM)

Like above lot of records are there, sometimes it's an extra 's', other times its an extra space.
Note: these positions are displayed in a drop down how to group by and display and while click that name I want to get all records with out data lost.

A:

This is a hard problem.
My recommendation is to start with a list of all distinct job positions:
select distinct job_position
from t;

Then, load this into a spreadsheet and manually put in the official name.  Then load this back into the database, and use it when updating and inserting the job position -- if a position is not in the table, then reject it.
You can then join to the table to get the official version.

A:

I would usually create a mapping table to permanently fix this. 
A quick fix that I usually use on query is to write a view like below:
Select 
Case when [Job Position] like '%Former Employee - SBM%' OR [Job Position] like '%Former Employee - Student Brand Manager%'
THEN 'SBM'
ELSE [Job Position] END as 'Job Position'
,[Field 2], [Field 3], ...

FROM TABLENAME

OR
Select 
Case when [Job Position] in ('Former Employee - SBM (Student Brand Manager)','Former Employee - SBM','Former Employee - Student Brand Manager','Former Employee - Student Brand Manager (SBM)')
THEN 'SBM'
ELSE [Job Position] END as 'Job Position'
,[Field 2], [Field 3], ...

FROM TABLENAME

