MySQL参数化查询的IN 和 LIKE

https://stackoverflow.com/questions/650455/c-sharp-parameterized-query-mysql-with-in-clause
https://stackoverflow.com/questions/773641/mysql-parameterized-query-using-like

 

int status = 4;  
string ids = "1,14,145,43";      

m.Parameters.AddWithValue("@Status", status);
m.Parameters.AddWithValue("@IDs", ids);

UPDATE TABLE_1 SET STATUS = @Status WHERE FIND_IN_SET(ID, @IDs) > 0;
posted @ 2018-08-02 14:54  Mr▪King  阅读(185)  评论(0编辑  收藏  举报