[mythtv-users] Tip for finding duplicated channel numbers

Karl Newman siliconfiend at gmail.com
Thu Jun 25 04:22:29 UTC 2015


Hi list,

I've noticed that Comcast periodically updates the channels, sometimes
replacing a channel with the Pacific feed, or sometimes replacing it with a
different feed altogether. mythfilldatabase picks up these new channels but
doesn't delete the old ones. I can't say I've experienced any problems
because of it (no false recordings, etc.), but I do like to keep my
database clean. So I found a nice SQL query that will identify those
duplicated/replaced channels and then I can use mythweb to nuke them from
orbit. Here's the statement to use:
SELECT channum, sourceid, COUNT(1) AS CNT FROM channel GROUP BY channum,
sourceid HAVING COUNT(1) > 1;
Then just go through each of the channum entries and prune the extra
channel.

Giving credit to
http://www.tech-recipes.com/rx/49959/finding-duplicate-records-using-group-by-in-sql-server/

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150624/02c324f0/attachment.html>


More information about the mythtv-users mailing list