我写MySQL中的过程将通过DESC一个字符串值,从而,如何通过声明
IN `para` varchar(4)
BEGIN
#Routine body goes here...
if (para = 'asc') THEN
SELECT officeCode, city, country
from offices
ORDER BY country ;
ELSE
SELECT officeCode, city, country
from offices
ORDER BY country DESC;
END if;
END
该代码是好的,但我不知道是否有任何其他方法,使短,像这样的(第为参数时调用程序):
BEGIN
SELECT officeCode, city, country
from offices
ORDER BY country *para* ;
END
--------but this is not work-------