This query is marked as a draft This query has been published by Edgars2007.

SQL

AخA
 
use lvwiki_p;
SELECT DISTINCT
CONCAT('#[[:Kategorija:',cl_to,']]') as "Nosaukums"
  #cl_to
FROM categorylinks AS cat
JOIN page AS pg1
ON cat.cl_from = pg1.page_id
WHERE page_namespace = 2
AND EXISTS (SELECT
              1
            FROM page AS pg2
            JOIN categorylinks AS cl
            ON pg2.page_id = cl.cl_from
            WHERE pg2.page_namespace = 0
            AND cat.cl_to = cl.cl_to)
LIMIT 250;
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...