Who added this [tag] to the question?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

declare @question int = 1;
declare @reTag int = 6;
declare @initTag int = 3;
declare @tagToSearch nvarchar(35) = ##tag:string?google-apps-script-simple-triggers##;


select
MAX(CreationDate),
PostId as [Post Link],
FIRST_USER AS [User Link]
--,P.PostHistoryTypeId,
--P.Text
from
(SELECT
FIRST_VALUE(PH.UserId) OVER (PARTITION BY PH.PostId ORDER BY PH.CreationDate) AS FIRST_USER,
*
FROM 
PostHistory as PH
WHERE
(PH.PostHistoryTypeId = @reTag
or
PH.PostHistoryTypeId = @initTag
)
and
PH.Text like '%<' + @tagToSearch + '>%'
) AS P



group by
PostId,FIRST_USER
--,P.PostHistoryTypeId,P.Text

Enter Parameters

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