SELECT COALESCE(SUBSTRING(Location,0,
CHARINDEX('-',Location)),Location)
FROM #t
Output:
If you have any question, please feel free to let me know.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.