SELECT DISTINCT p.Id INTO #QuestionIds FROM Posts p INNER...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

SELECT DISTINCT p.Id
INTO #QuestionIds
FROM Posts p
INNER JOIN PostTags pt ON p.Id = pt.PostId
INNER JOIN Tags t ON pt.TagId = t.Id
WHERE t.TagName IN (
  'science-based',
  'biology',
  'planets',
  'physics',
  'evolution',
  'space',
  'xenobiology',
  'space-travel',
  'spaceships',
  'geography',
  'climate',
  'gravity',
  'fauna',
  'moons',
  'atmosphere',
  'orbital-mechanics',
  'space-colonization',
  'astronomy',
  'flora',
  'geology',
  'chemistry',
  'earth',
  'weather',
  'energy',
  'engineering',
  'space-constructs',
  'artificial-intelligence',
  'stars',
  'psychology',
  'anatomy',
  'biochemistry',
  'underwater'
)
AND p.Tags NOT LIKE '%magic%'
AND p.Tags NOT LIKE '%warfare%'
AND p.Tags NOT LIKE '%weapons%'
AND p.Tags NOT LIKE '%medieval%'
AND p.Tags NOT LIKE '%government%'
AND p.Tags NOT LIKE '%religion%'
AND p.Tags NOT LIKE '%worldbuilding-process%'
AND p.Tags NOT LIKE '%military%'
AND p.Tags NOT LIKE '%law%'
AND p.Tags NOT LIKE '%combat%'
AND p.Tags NOT LIKE '%military-defense%'
AND p.Tags NOT LIKE '%worldbuilding-resources%'
AND p.Tags NOT LIKE '%gods%'
AND p.Tags NOT LIKE '%medieval-europe%'
AND p.Tags NOT LIKE '%crime%'
AND p.ClosedDate IS NULL
AND p.PostTypeId = 1;

SELECT Id, PostTypeId
FROM Posts
WHERE Id IN (SELECT Id FROM #QuestionIds)
   OR ParentId IN (SELECT Id FROM #QuestionIds)
FOR JSON AUTO;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results