Parameters: @UserId, @RoleId
In a Table I have the columns: Id, MyText, AccessId, AuthorId
AccessId can have value 1,2, 3.
If AccessId is 1 the row should be returned.
It it is 2, then only return row if @UserId=@AuthorId
If it is 3, then only return row if @RoleId=5.
Can you please help me write a query for this?