MYSQL testing string field contains another altered string field
I found this solution : 

mysql&gt; update mytab set difference=(template not like concat('%|',value,'|%'));
Query OK, 0 rows affected (0.05 sec)
Rows matched: 3  Changed: 0  Warnings: 0

mysql&gt; select * from  mytab;
+----+-------+----------------+------------+
| id | value | template       | difference |
+----+-------+----------------+------------+
|  1 | 7     | |2|5|7|8|9|12| |          0 |
|  2 | 0     | |5|            |          1 |
|  3 | 5     | |2|5|7|8|9|12| |          0 |
+----+-------+----------------+------------+
3 rows in set (0.00 


sec)