按照网上的教程,写了个小练习,可是报错 求大神帮忙看看 赳赳错 DELIMITER //
create function get_tot_ords(in c_num int) Returns doubleBegindeclare tot_ord double;
select sum(amount) into tot_ord from orders where cust = c_num;
return tot_ord;End;
//
create function get_tot_ords(in c_num int) Returns doubleBegindeclare tot_ord double;
select sum(amount) into tot_ord from orders where cust = c_num;
return tot_ord;End;
//
DROP FUNCTION IF EXISTS get_tot_ords//
CREATE FUNCTION get_tot_ords(c_num INT) RETURNS DOUBLE
BEGIN
DECLARE tot_ord DOUBLE;
SELECT SUM(amount) INTO tot_ord FROM orders WHERE cust = c_num;
RETURN tot_ord;
END;//
DELIMITER ;