一个苯办法,多次使用union allmysql> select id from haha;
+----+
| id |
+----+
| 1 |
| 2 |
+----+
2 rows in set (0.01 sec)mysql> select id from haha where id=1
-> union all
-> select id from haha where id=1
-> union all
-> select id from haha where id=1
-> union all
-> select id from haha where id=1
-> union all
-> select id from haha where id=2;
+----+
| id |
+----+
| 1 |
| 1 |
| 1 |
| 1 |
| 2 |
+----+
5 rows in set (0.05 sec)
+----+
| id |
+----+
| 1 |
| 2 |
+----+
2 rows in set (0.01 sec)mysql> select id from haha where id=1
-> union all
-> select id from haha where id=1
-> union all
-> select id from haha where id=1
-> union all
-> select id from haha where id=1
-> union all
-> select id from haha where id=2;
+----+
| id |
+----+
| 1 |
| 1 |
| 1 |
| 1 |
| 2 |
+----+
5 rows in set (0.05 sec)
关键是楼主要在那里应用