Posts containing one of the given words (ordered by LastActivityDate)

1

Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

declare @words nvarchar(max) = ##links:string##
declare @list nvarchar(max)
declare @sql nvarchar(max)

select @list = string_agg(concat('(Body LIKE ''%', value,'%'')'), ' OR ')
from string_split(@words, ',')

set @sql = concat(N'SELECT TOP 100 Id As [Post Link], CreationDate, LastActivityDate, Body
  FROM Posts WHERE ',@list,N' ORDER BY LastActivityDate DESC')

print @sql

exec(@sql)

Enter Parameters

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