[mythtv-users] mysql to delete empty channels

Robin Gilks g8ecj at gilks.org
Sun Oct 30 18:32:27 EST 2005


> On 30/10/05, Robin Gilks <g8ecj at gilks.org> wrote:
>> Does anyone know mysql well enough to tell me how I delete all the
>> extranious channels that have no channel number (or null channel number)
>> that mythfilldatabase has added in the last month or so?
>
> Check whether this works when you are in MySQL and are using the
> mythconverg database:
>
> SELECT * FROM `channel` WHERE `channum` = "";
>
> Per the table structure, channum cannot be NULL, so I'm guessing the
> fields are just empty. The above query should therefore give you a
> list of all channels that have missing channel numbers.
>
> In order to delete them all in one go, do
>
> DELETE FROM `channel` WHERE `channum` = "";
>
> Remember, backup your DB beforehand and the usual disclaimers apply.
>
> Nick

Perfect - thanks Nick. I hadn't got the "" diference to NULL which was
where I was failing.

Cheers

-- 
Robin Gilks






More information about the mythtv-users mailing list