菜鸟提问,怎么判断行数?
SELECT COUNT(*) FROM Collect WHERE userID=@id
IF(@@ROWCOUNT>=12)
RETURN 1 --已经满了最多12个
@@ROWCOUNT不会大于12,应该这样写错了,正确的该怎么写
------解决方案--------------------DECLARE @rowcount INT
SELECT @rowcount=COUNT(*) from Collect WHERE userID=@id
SELECT @rowcount
------解决方案--------------------declare @cnt int
SELECT @cnt=COUNT(*) FROM Collect WHERE userID=@id
IF(@cnt>=12)
RETURN 1
------解决方案--------------------水锅long time no see