Mysql/sqlserver where in parameter passing problem parameter: @ p0 = 1, 2, 3, 4 1. the common query is as follows: select * from table_name t where t. field1in (1, 2, 3, 4 ,...); select * from table_name t where t. field1in (@ p0); the final SQL statement is select * from table_name t where t. field1in ('1, 2, 3, 4 ,... '); only t. the result of field1 = 1 (the specific reason for finding the first record to be studied) is not feasible if all parameters can be found. In this case, use solution 2 in step 2. find_in_set use this method to obtain select * from table_name t where find_in_set (t. field1, '1, 2, 3, 4 '); The following is the related sorting and sqlserver solution MySQL/sqlserver query in operation query results are displayed in the in set Order select * from ibs6_terminal_adv_inf where id in (, 15) order by field (id, 16,14, 15) select * from ibs6_terminal_adv_inf where id in (16,14, 15) order by find_in_set (id, '16, 14,15 ') select * from ibs6_terminal_adv_inf where id in (16,14, 15) order by substring_index ('16, 14,15', id, 1) the result shows in sequence that sqlserver uses the following statement select * from ibs6_terminal_adv _ Inf where id in (16,14, 15) order by CHARINDEX (',' + ltrim (id) + ', 16,14, 15 ,') "This method has not been tested. If you have tested it, you can check the result. There are many commas (,) in it, so you cannot leave it empty ~~~