某些情况下我们可能需要按照where in(2,7,3,5)这样查询的接口排序 默认情况下不是按照这个来的 以下方法ORDER BY FIELD 可以实现
SELECT * FROM table WHERE id IN(2,7,3,5) ORDER BY FIELD(id,2,5,3,7);(mysql)
----------------------
还有就是用union all 、
alter table song_hot_content modify qq bigint(64) ;
create index starthot_type_index on star_hot_content(`type` asc);
alter table book_upload_file_t add signflag int default 0 ;
mysqldump -uroot db_music_focus >db_music_focus.sql
SELECT * FROM table WHERE id IN(2,7,3,5) ORDER BY FIELD(id,2,5,3,7);(mysql)
----------------------
还有就是用union all 、
for(int i=0;i<albumidsArray.length;i++){
sql+= "select * from Music_Res_DB.t_album where Falbum_id = '"+albumidsArray[i]+"'";// where music_name like %"+ufd.getMusicName()+"%";//
if(i!=albumidsArray.length-1){
sql+=" union all ";
}
}
alter table song_hot_content modify qq bigint(64) ;
create index starthot_type_index on star_hot_content(`type` asc);
alter table book_upload_file_t add signflag int default 0 ;
mysqldump -uroot db_music_focus >db_music_focus.sql