SQLTeam.com | Weblogs | Forums

Separating column values


I have a column values like below, one column but separated by |

How can I retrieve values that are only ACH and outpatients

ACH |Emergency |ED Trauma C/D |
ACH |Emergency |ED Trauma Room |
ACH |Emergency |ED Triage |
ACH |Emergency |ED Waiting Room|
ACH |Emergency |ED-Emerg |
ACH |Outpatients |
ACH |Outpatients |ACETS |
ACH |Outpatients |ACH-Hemo |
ACH |Outpatients |ACH-Perito |
ACH |Outpatients |ACH-TESTOP |
ACH |Outpatients |AHS RP01 |


Try this:

select yourcolumn
  from yourtable
 where yourcolumn like 'ACH |Outpatients |%'


That is ok, but I need to separate these values in different columns. .


Use Jeff Moden's DelimitedSplit8K