Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
Hello All,

I have one table called as [EmployeeStatus]

and schema as below

EmpID BIGINT
EventDescription NVARCHAR(MAX)

AND Below is the data

EmpID EventDescription
1 Employee Status [PM][AG][OP]
1 Employee Status [PM][AG]

AND I want below output
EmpID EventDescription
1 Employee Status [OP]

Note here I want to remove similar words ([PM] and [AG])

Please let me know how I can achieve this with one select statement


Thanks in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 27-Feb-12 17:18pm    
Not clear how can you define "similar".
--SA
RDBurmon 28-Feb-12 3:22am    
by comparing words in square bracket [*****]
N Haque 28-Feb-12 4:27am    
is "Employee Status" string fixed or not considerable? Can I consider only the [**] third bracketed word??
RDBurmon 28-Feb-12 5:17am    
No they are not fixed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900