56,687
社区成员
发帖
与我相关
我的任务
分享
CREATE PROCEDURE TEST()
BEGIN
DECLARE I INT;
SET I = 0;
SELECT COUNT(DB_KEY) INTO I FROM Skr2.mc_config m;
SELECT I;
END;
这样写那里有错误.
谢谢楼上的各位大侠帮忙,问题解决了,代码如下:
SELECT
sum(case when month(time_s) = 1 then time_ms/60 else 0 end),
sum(case when month(time_s) = 2 then time_ms/60 else 0 end),
sum(case when month(time_s) = 3 then time_ms/60 else 0 end),
sum(case when month(time_s) = 4 then time_ms/60 else 0 end),
sum(case when month(time_s) = 5 then time_ms/60 else 0 end),
sum(case when month(time_s) = 6 then time_ms/60 else 0 end),
sum(case when month(time_s) = 7 then time_ms/60 else 0 end),
sum(case when month(time_s) = 8 then time_ms/60 else 0 end),
sum(case when month(time_s) = 9 then time_ms/60 else 0 end),
sum(case when month(time_s) = 10 then time_ms/60 else 0 end),
sum(case when month(time_s) = 11 then time_ms/60 else 0 end),
sum(case when month(time_s) = 12 then time_ms/60 else 0 end)
FROM e_1221463846 E
LEFT JOIN WEB.WEB_EVENTS_10 W
ON E.EVENT_TYPE = W.TYPE_ID
AND E.EVENT_ID = W.EVENT_ID
WHERE W.TYPE_ID = 2
这个语句那里有错误,
SELECT
sum(case when month(time_s) = 1 then time_ms/60.0 else 0),
sum(case when month(time_s) = 2 then time_ms/60.0 else 0),
sum(case when month(time_s) = 3 then time_ms/60.0 else 0),
sum(case when month(time_s) = 4 then time_ms/60.0 else 0),
sum(case when month(time_s) = 5 then time_ms/60.0 else 0),
sum(case when month(time_s) = 6 then time_ms/60.0 else 0),
sum(case when month(time_s) = 7 then time_ms/60.0 else 0),
sum(case when month(time_s) = 8 then time_ms/60.0 else 0),
sum(case when month(time_s) = 9 then time_ms/60.0 else 0),
sum(case when month(time_s) = 10 then time_ms/60.0 else 0),
sum(case when month(time_s) = 11 then time_ms/60.0 else 0),
sum(case when month(time_s) = 12 then time_ms/60.0 else 0)
FROM e_1221463846 E
LEFT JOIN WEB.WEB_EVENTS_10 W
ON E.EVENT_TYPE = W.TYPE_ID
AND E.EVENT_ID = W.EVENT_ID
WHERE W.TYPE_ID = 2
我这个工具没有命令行呢,命令行在那里呢.
比如在SQLYOG中是SHIFT+F9。这个是做什么用的,我是第一次用mysql
多谢指教.
错误图片如下:
我是放在mysql Query Browser可视化操作界面这个工具里面