Posts where OwnerUserId

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow на русском Meta

Вопросы и ответы о сайте для программистов

-- Dump your own question posts and answer posts (for backup purposes).

DECLARE @UserId int = 470749;

-- Get my questions
select Id as [Post Link], body, tags, ParentId, OwnerUserId
from Posts 
where OwnerUserId = @UserID AND ParentId IS NULL

UNION 

-- Get my answers
select Id as [Post Link], body, tags, ParentId, OwnerUserId
from Posts 
where OwnerUserId = @UserID AND ParentId IS NOT NULL
ORDER BY OwnerUserId ASC;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results