Fork of Untitled query #87003 by IKhitron
This query is marked as a draft This query has been published by IKhitron.

SQL

x
 
select concat('# [[', page_title, ']] -> [[', rd_title, ']]') as answer from redirect join page
on page_id = rd_from
where rd_title like '%(станция_метро)'
and not page_title like '%(%'
and rd_title = concat(page_title, '_(станция_метро)')
and not exists
(select * from page_props
 where pp_propname = 'disambiguation'
 and pp_page in
 (select page_id from page
  where page_title = rd_title
  and page_namespace = rd_namespace))
and exists
(select * from templatelinks
 where tl_from in (select page_id from page
  where page_title = rd_title
  and tl_target_id in (21855, 44105)
  and page_namespace = rd_namespace))
order by rd_title
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.

Checking query status...