我已經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