请帮我找到我犯错的地方吗?哪里错了?
delimiter //
CREATE FUNCTION `count_photos_in_gallery`(`tmp_gallery_id` INT(11) NOT NULL) RETURNS TINYINT(3) UNSIGNED
BEGIN
DECLARE `tmp_count` TINYINT(3) UNSIGNED DEFAULT 0;
SELECT COUNT(`id`) INTO `tmp_count` FROM `photos_items` WHERE `gallery_id`=`tmp_gallery_id` LIMIT 1;
RETURN `tmp_count`;
END//
错误:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) RETURNS TINYINT(3) UNSIGNED BEGIN DECLARE
tmp_count
TINYINT(3) UNSI' at line 1
那么,我们如何才能发现其中的错误如果我们不知道问题是什么? – 2012-03-28 07:28:23
你为什么认为有错误?你得到的错误是什么? – Gavriel 2012-03-28 07:28:51
定义READS SQL DATA后返回语句 – silly 2012-03-28 07:30:13