MySQL Use an In Clause With a Comma Delimited Column I am trying to use a column that has a comma delimited list of values in an in clause.  I thought about doing a contains but it would not be correct when searching for single digit values.
Example:  1,5,12,14,16,15,18,19,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,40,41,43,44,45,47,48,49,51,53,54,55,56,57,59,61,62,63,64,65
This is the error that I am getting:

[MySql.Data]  
ErrorCode: -2147467259, Number: 1064  
ErrorMessage: You have an error in your SQL syntax; check the manual that  
corresponds to your MySQL server version for the right syntax to use near  
'cpei5.value' at line 12


Here is my query:
SELECT soi.*
FROM   sales_order_item soi
       INNER JOIN sales_order so
            ON  so.entity_id = soi.order_id
       INNER JOIN sales_order_address soa
            ON  soa.parent_id = so.entity_id
       INNER JOIN catalog_product_entity cpe
            ON  cpe.sku = soi.sku
       INNER JOIN catalog_product_entity_text cpei5
            ON  cpei5.row_id = cpe.entity_id
       INNER JOIN eav_attribute ea5
            ON  ea5.attribute_code LIKE 'state_not_allowed'
            AND ea5.attribute_id = cpei5.attribute_id
WHERE  soa.address_type = 'shipping'
       AND date_add(so.created_at, interval 365 DAY) &gt;= CURRENT_DATE()
       AND date_add(so.created_at, interval 365 DAY) &lt;= date_add(CURRENT_DATE(), interval 30 DAY)
       AND cpe.type_id = 'simple'
       AND soa.region_id IN cpei5.value
col IN (1,2,34)        -- A
col IN (&quot;1,2,34&quot;)      -- B
col IN (&quot;1&quot;,&quot;2&quot;,&quot;34&quot;)  -- C

Binding tends to produce B, but...
A and C have 3 choices, B has only one choice (a 6-character string)
Both A and C work if col is INT; C works if col is VARCHAR.
A, B, and C, may be able to use an INDEX.
FIND_IN_SET(col, &quot;1,2,34&quot;)  -- D

Find_in_set has these characteristics:

Easy to 'bind'
Won't use an INDEX
Works with strings or numbers.