Tags with version numbers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow на русском

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

select
  t1.Id,
  t1.TagName,
  t1.Count,
  t2.TagName,
  t2.Count,
  t3.TagName,
  t3.Count,
  t4.TagName,
  t4.Count
from
  Tags as t1
left join
  Tags as t2 on
    t1.TagName like concat(
      t2.TagName COLLATE Latin1_General_CI_AS,
      '[0-9]' COLLATE Latin1_General_CI_AS)
    or t1.TagName like concat(
      t2.TagName COLLATE Latin1_General_CI_AS,
      '-[0-9]' COLLATE Latin1_General_CI_AS)
left join
  [StackOverflow]..Tags as t3 on
    t1.TagName = t3.TagName
left join
  [StackOverflow]..Tags as t4 on
    t1.TagName like concat(
      t4.TagName COLLATE Latin1_General_CI_AS,
      '[0-9]' COLLATE Latin1_General_CI_AS)
    or t1.TagName like concat(
      t4.TagName COLLATE Latin1_General_CI_AS,
      '-[0-9]' COLLATE Latin1_General_CI_AS)
where
  t1.TagName like '%[0-9]'
order by
  t1.Count desc

Enter Parameters

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