这是我第一次编写存储过程。这是我的存储过程
CREATE DEFINER=`test`@`%` PROCEDURE `List`(OUT id INT, OUT SCORE INT)
BEGIN
select (Listing.Viewcount * 0.4) + count(Bookmarks.ListingId * 0.6) As Score INTO SCORE, distinct(Listing.ListingId) INTO id
from Listing,Bookmarks
where Listing.ListingId = Bookmarks.ListingId
group by Listing.ListingId
order by Score desc
Limit 10;
END
它在select语句中出现错误,说“语法错误:意外(明显)不同”。我无法弄清楚为什么这是错的? 非常感谢帮助! :) 感谢。
答案 0 :(得分:0)
CREATE DEFINER=`test`@`%` PROCEDURE `List`(OUT id INT, OUT SCORE INT)
BEGIN
select (Listing.Viewcount * 0.4) + count(Bookmarks.ListingId * 0.6),distinct(Listing.ListingId)
INTO SCORE, id
from Listing,Bookmarks
where Listing.ListingId = Bookmarks.ListingId
group by Listing.ListingId
order by Score desc
Limit 1;
END