Avada Car Dealer News

Because maccms10 (apple cms) collection data is convenient, online templates are also a whole lot, half an hour to build a good movie site, many friends use it. But with more and more collection sources may cause a lot of duplication of movie or actor data, which is not very search engine friendly, and a lot of duplicate data for website SEO is also a big taboo.

Although Apple cms background VOD data de-weighting function, but no actors or other data de-weighting function, just today He big brother again in consultation with this problem, through my some Baidu combined with the operation of other big brothers, finally found a way. Here is a record.

The problem of maccms10 of He Daji
The problem of maccms10 of He Daji

Of course, you can just use the one-click delete weight function in the background. But the actor data does not seem to have this function.

maccms10 one click delete weight function
maccms10 one click delete weight function

I. Delete duplicate actor data from MACCMS10

Actor table table name: mac_actor (if your database table prefix has changed, please change the red part).

The function of the following sql statement is to delete the duplicate data of actor_name [actor name] in mac_actor table to keep the one with the smallest id. It's a bit roundabout. In layman's terms: if there is the same (duplicate) actor name, delete it, but keep the one with the smallest id, so that there will be no duplicate data.

DELETE
FROM mac_actor
WHERE actor_name IN(SELECT
actor_name
FROM (SELECT
actor_name
FROM mac_actor
GROUP BY actor_name
HAVING COUNT(actor_name) > 1) a)
AND actor_id NOT IN(SELECT
*
FROM (SELECT
MIN(actor_id)
FROM mac_actor
GROUP BY actor_name
HAVING COUNT(actor_name) > 1) b)

The above sql statement can be copied and pasted directly to run.

But be careful: if your table name or database prefix has changed, please replace the red part with the same table name or field as yours.

Above know to delete the duplicate data of actors, that duplicate delete movie data is not difficult, replace some table names and fields will not be OK.

Second, delete MACCMS10 duplicate movie name data

Replace it OK, delete the duplicate movie name to keep the one with the smallest id, come to see the complete SQL.

DELETE
FROM mac_vod
WHERE vod_name IN(SELECT
vod_name
FROM (SELECT
vod_name
FROM mac_vod
GROUP BY vod_name
HAVING COUNT(vod_name) > 1) a)
AND vod_id NOT IN(SELECT
*
FROM (SELECT
MIN(vod_id)
FROM mac_vod
GROUP BY vod_name
HAVING COUNT(vod_name) > 1) b)

If you are the default database, just copy and paste it to run it OK. But if you have changed the table prefix, the red part is still need to pay attention to, remember to modify oh. The following is a screenshot of the success after testing.

maccms10 delete duplicate data test
maccms10 delete duplicate data test

The specific function of each sentence I will not narrate, because I am also very scum, see all headache, you take directly to use no problem, is tested by me.

The above is maccms10 movie or actor library data using sql statements to de-duplicate the method, are tested by me can directly copy and paste to run, I hope it will be helpful to you.

Leave A Comment