我已经5.0.10创建存储过程在MySQL
delimiter //
CREATE PROCEDURE getTweets (var1 varchar(100))
LANGUAGE SQL
SQL SECURITY DEFINER
COMMENT 'A procedure to return 20 least scored tweets based on the temp sessionid of the user'
BEGIN
SELECT count(ts.tweetid) as "count",t.id as "tweetid", t.tweettext as "tweet"
FROM tweets t
LEFT JOIN tweetscores ts ON t.id = ts.tweetid
where t.id not in (select distinct(tweetid) from tweetscores where temp_sessionid=var1)
group by t.id, t.tweettext order by count
LIMIT 10;
END//
我一直为在MySQL中创建一个存储过程以下语法收到错误
#1064 - 你有一个错误你的SQL语法; 检查对应于你的MySQL服务器版本在线路附近使用“//”正确的语法手册12
有谁能够发现错误..
适合我。你如何执行它? – 2015-01-21 08:39:00
尝试在下一行保留分隔符 – 2015-01-21 08:39:25
@juergend只需点击phpmyadmin中的go按钮... – dakait 2015-01-21 08:52:35