Posted By

samwa on 09/22/10


Tagged

sql


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

samwa
Tyster


sql filter column by csv string


 / Published in: SQL
 

  1. --
  2. DECLARE @CSV varchar(max)
  3.  
  4. SELECT *
  5. FROM some_table
  6. WHERE ',' + @CSV + ',' LIKE '%,' + some_field + ',%'

Report this snippet  

You need to login to post a comment.