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


You need to login to view comments.