I have a simple SQL statement that is to get the first rowid from question, but it gives an error thanks to too many items return. So how can I fix it ?
DECLARE @first_id int
select @first_id = (SELECT row_number() over (order by id) as id FROM question)
SELECT @first_id = id FROM question >> this syntax works fine but not what I want from query result.
Thanks
Try this