sql filter column by csv string


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. --
  2. DECLARE @CSV VARCHAR(MAX)
  3.  
  4. SELECT *
  5. FROM some_table
  6. WHERE ',' + @CSV + ',' LIKE '%,' + some_field + ',%'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.