Merge Topics with S to topic with s with a 3 times articles difference
e.g. Electronic Device merged to Electronic Devices
select b.topic_id, a.topic_id, b.title as 'title to be merged', b.articles, a.title , a.articles from topic a, topic b where a.articles <50 and a.articles >0 and b.articles >0 and (a.title like '%s' ) and b.title = substring(a.title, 1, char_length(a.title)-1) and (a.articles div b.articles >= 3 ) limit 100000;
Merge topic with S to topic without s with a 3 times articles difference
e.g. Gamings to Gaming
SELECT
b.topic_id,
b.title as ' merged titles',
a.topic_id,
a.title AS 'parent title',
b.articles as 'merged articles',
a.articles as 'parent article'
FROM
topic a,
topic b
WHERE
b.articles < 20 AND b.articles > 0
AND a.articles>0
AND (b.title LIKE '%s')
AND a.title = SUBSTRING(b.title,
1,
CHAR_LENGTH(b.title) - 1)
AND (a.articles DIV b.articles >= 3)
LIMIT 100000;
e.g. Electronic Device merged to Electronic Devices
select b.topic_id, a.topic_id, b.title as 'title to be merged', b.articles, a.title , a.articles from topic a, topic b where a.articles <50 and a.articles >0 and b.articles >0 and (a.title like '%s' ) and b.title = substring(a.title, 1, char_length(a.title)-1) and (a.articles div b.articles >= 3 ) limit 100000;
Merge topic with S to topic without s with a 3 times articles difference
e.g. Gamings to Gaming
SELECT
b.topic_id,
b.title as ' merged titles',
a.topic_id,
a.title AS 'parent title',
b.articles as 'merged articles',
a.articles as 'parent article'
FROM
topic a,
topic b
WHERE
b.articles < 20 AND b.articles > 0
AND a.articles>0
AND (b.title LIKE '%s')
AND a.title = SUBSTRING(b.title,
1,
CHAR_LENGTH(b.title) - 1)
AND (a.articles DIV b.articles >= 3)
LIMIT 100000;
Comments