我的查询
select * from product where productId in(25,36,40,1,50);
结果如下
`productId ProductName Qty Price` ------------------------------------- `1 | namesome | 5 | 25.00` `25 | namesome | 5 | 35.00` `36 | namesome | 5 | 35.00` `40 | namesome | 5 | 35.00` `50 | namesome | 5 | 35.00`
我没有使用任何order by子句,但是它的自动应用顺序是productId, 我需要没有任何排序的结果,如下所示
order by
productId
`productId ProductName Qty Price` ------------------------------------- `25 | namesome | 5 | 25.00` `36 | namesome | 5 | 35.00` `40 | namesome | 5 | 35.00` `1 | namesome | 5 | 35.00` `50 | namesome | 5 | 35.00`
我怎样才能做到这一点? 数据库引擎:MyIsam,整理:utf8_general_ci,主键打开productId
select * from product where productId in(25,36,40,1,50) order by find_in_set(productId, ‘25,36,40,1,50’);