删除并且返回值,我试了三个表,都是类似的错误,求大神帮忙看看
mysql> SELECT * FROM users5;
+----+----------+----------+-----+------+
| id | username | password | age | sex |
+----+----------+----------+-----+------+
| 1 | TOM | 123 | 10 | 0 |
| 2 | John | 123 | 23 | 1 |
+----+----------+----------+-----+------+
2 rows in set (0.03 sec)
mysql> DESC users5;
+----------+----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------------------+------+-----+---------+----------------+
| id | smallint(5) unsigned | NO | PRI | NULL | auto_increment |
| username | varchar(20) | NO | | NULL | |
| password | varchar(32) | NO | | NULL | |
| age | tinyint(3) unsigned | NO | | 10 | |
| sex | tinyint(1) | YES | | NULL | |
+----------+----------------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
mysql> DELIMITER //
mysql> CREATE PROCEDURE removeAndReturn(IN u_id INT UNSIGNED,OUT users5nums INT UNSIGNED)
-> BEGIN
-> DELETE FROM users5 WHERE id = T_id;
-> SELECT count(id) FROM users5 INTO users5nums;
-> END
-> //
ERROR 1064 (42000): 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 'UNSIGNED)
BEGIN
DELETE FROM users5 WHERE id = T_id;
SELECT count(id) FROM user' at line 1