WITH distinct_source_tag_name AS ( SELECT DISTINCT Source...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Chinese Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Chinese language

WITH 
distinct_source_tag_name AS
(
SELECT DISTINCT SourceTagName 
FROM TagSynonyms 
WHERE lower(SourceTagName) LIKE '%css%'
),
distinct_target_tag_name AS
(
SELECT DISTINCT TargetTagName 
FROM TagSynonyms 
WHERE lower(TargetTagName) LIKE '%css%'
),
css_tags AS
(
  SELECT 
  t.TagName, 
  t.Id, 
  ts1.SourceTagName as source_tag_name_if_joined_by_it,
  ts2.TargetTagName as target_tag_name_if_joined_by_it,
  pt.PostId
  FROM Tags t
  LEFT JOIN distinct_source_tag_name ts1
  ON t.TagName = ts1.SourceTagName
  LEFT JOIN distinct_target_tag_name ts2
  ON t.TagName = ts2.TargetTagName
  JOIN PostTags pt
  ON pt.TagId = t.Id
  WHERE lower(TagName) LIKE '%css%'
)
SELECT *
FROM css_tags

Enter Parameters

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