I'm continue discovering SQL and store procedure, having trouble that @feedid is returning only 1 id, but it have for ex. 20. How to return array of id's?
CREATE PROC spGetItemsByUser
@userName NVARCHAR(50)
AS BEGIN
DECLARE @userId INT,
@feedId INT;
SELECT @userId = ID
FROM users
WHERE name = @userName
SELECT @feedId = feedid
FROM userstofeed
WHERE userid = @userId
SELECT *
FROM feed
WHERE ID = @feedId
END