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

SQL

AخA
 
SELECT
    extracted_bold_word
FROM
    (SELECT
        SUBSTRING_INDEX(old_text, '.', 1) AS first_sentence,
        page_title
     FROM page
     INNER JOIN slots ON page_latest = slot_revision_id
     INNER JOIN slot_roles ON slot_role_id = role_id AND role_name = 'main'
     INNER JOIN content ON slot_content_id = content_id
     INNER JOIN text ON substring(content_address, 4) = old_id AND left(content_address, 3) = 'tt:'
    ) AS sentences
CROSS JOIN LATERAL -- Use LATERAL JOIN to process each row from 'sentences' independently
    (SELECT
        REPLACE(REPLACE(extracted_word_list.val, '''', ''), '_', ' ') as extracted_bold_word
        FROM
        (SELECT
            -- Extract all bolded words using REGEXP_EXTRACT_ALL (MariaDB 10.6+)
            -- For older versions, a different approach would be needed (more complex)
            JSON_TABLE(
                REGEXP_EXTRACT_ALL(sentences.first_sentence, '''([^''']+)''' ), -- Extracts content between ''' and '''
                '$[*]' COLUMNS (val VARCHAR(255) PATH '$')
            ) AS extracted_word_list
         ) AS extracted_word_table
     ) AS bold_words
WHERE extracted_bold_word IS NOT NULL AND extracted_bold_word <> ''
HAVING
    NOT EXISTS (
        SELECT 1
        FROM page AS p2
        WHERE LOWER(p2.page_title) = LOWER(extracted_bold_word)
    );
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...