Got you, don't know much about mysql. below is my solution for oracle. CREATE OR REPLACE TYPE IDCOLLECTION AS TABLE OF NUMBER; SELECT t1.* FROM table t1, (SELECT COLUMN_VALUE id, ROWNUM seqno FROM TABLE (idcollection (1,2,5,4,3))) t2 WHERE t1.id = t2.id ORDER BY t2.seqno;
see "stupid solution", think you are replying my post. haha. btw ,should be "union all" ba
【在 a*******s 的大作中提到】 : stupid solution : select id from table where id = 1 union select id from table where id = 2 : union select id from table where id = 5 union .....