DELIMITER //
CREATE DEFINER=`root`@`%` PROCEDURE testProc()
BEGIN
SELECT "Hello 1" AS A, "World 1" AS B UNION ALL
SELECT "Hello 2" AS A, "World 2" AS B;
END //
DELIMITER ;
mysql> call testProc();
+---------+---------+
| A | B |
| Hello 1 | World 1 |
| Hello 2 | World 2 |
2 rows in set (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
上面這種效果, 是你要的效果麼?
DELIMITER //
CREATE DEFINER=`root`@`%` PROCEDURE testProc()
BEGIN
SELECT "Hello 1" AS A, "World 1" AS B UNION ALL
SELECT "Hello 2" AS A, "World 2" AS B;
END //
DELIMITER ;
mysql> call testProc();
+---------+---------+
| A | B |
+---------+---------+
| Hello 1 | World 1 |
| Hello 2 | World 2 |
+---------+---------+
2 rows in set (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
上面這種效果, 是你要的效果麼?