按照网上的教程,写了个小练习,可是报错 求大神帮忙看看 赳赳错 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;
//
解决方案 »
- postgresql 用pg_restore将备份文件导入到指定的table
- mysql 数据库 一张表 可以存多少条数据?
- 更改mysql求助
- 两个表之间的触发器,出现问题,请大家帮忙看一下
- MySQL中存储中文用utf8还是gb2312? longtext是最长的字符类型吗,和varchar比呢?
- 怎样不让默认用户进入mysql呢? 直接打mysql就可以进去了.
- 关于MySQL和PostgreSQL的若干个问题,希望大家帮助!
- 添加新字段出错了,请各位给看看!
- 1405 Access denied for user '[email protected]' 问题
- 用sql语句获得一个月的日期 按下面的样式显示查询结果
- mysql存储过程游标以及建立临时表
- sql 显示数据库中的部分记录
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 ;