<p>How would you take an arbitrary list of strings (of the form "%[text]%") and a database column, and turn them into a SQL query that does a LIKE comparison for each string in the list?</p>

<p>An example: I have three strings in my list, "%bc%", "%def%" and "%ab%". This builds the query:</p>

<pre><code>([ColumnName] LIKE "%bc" AND [ColumnName] LIKE "%def%") AND [ColumnName] LIKE "%ab%"
</code></pre>

<p>A C# example would be excellent, but feel free to write it in the language of your choice.</p>

It's just a string join on a map:
```
```
>>> los=['ab', 'cd', 'ef']
>>> ' and '.join(("somecolumn like '%%%s%%'" % s) for s in los)
"somecolumn like '%ab%' and somecolumn like '%cd%' and somecolumn like '%ef%'"
```
```
or
```
```
>>> ' and '.join(("somecolumn like '%" + s + "%'") for s in los)
"somecolumn like '%ab%' and somecolumn like '%cd%' and somecolumn like '%ef%'"
```
```