mysql建立存储过程出错

CREATE PROCEDURE p_dir_info (in user varchar(20), in parent_path varchar(255))BEGIN select * from (select d.user, d.path , d.parent_path, d.dir, d.create_time ,(case isnull(sum(f.count)) when true then 0 else sum(f.count) end) as count,(case isnull(sum(f....
mysql建立存储过程出错
CREATE PROCEDURE p_dir_info (in user varchar(20), in parent_path varchar(255))
BEGIN
select * from
(select d.user, d.path , d.parent_path, d.dir, d.create_time ,
(case isnull(sum(f.count)) when true then 0 else sum(f.count) end) as count,
(case isnull(sum(f.size)) when true then 0 else sum(f.size) end) as size
from t_directories d left join
(select path, count(file) as count, sum(size) as size from t_files group by path) f on instr(f.path, d.path) = 1
where d.user=user and d.parent_path=parent_path group by path) dir order by create_time;
END;

仅保留这些代码我是实的能用2009-09-02
mengvlog 阅读 52 次 更新于 2025-10-30 02:53:00 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部