<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 11, 2022 at 7:04 PM David Engel <<a href="mailto:david@istwok.net">david@istwok.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Oct 11, 2022 at 05:21:02PM -0400, James Abernathy wrote:<br>
> On Mon, Oct 10, 2022 at 6:33 AM James Abernathy <<a href="mailto:jfabernathy@gmail.com" target="_blank">jfabernathy@gmail.com</a>><br>
> wrote:<br>
> <br>
> ><br>
> ><br>
> > On Sun, Oct 9, 2022 at 9:21 PM Stephen Worthington <<br>
> > <a href="mailto:stephen_agent@jsw.gen.nz" target="_blank">stephen_agent@jsw.gen.nz</a>> wrote:<br>
> ><br>
> >> On Sun, 9 Oct 2022 11:27:53 -0400, you wrote:<br>
> >><br>
> >> >Thanks, this is very useful.  I got what I needed out of a simple:<br>
> >> >select chanid,channum from channel; but yours is more useful.<br>
> >> ><br>
> >> >I tried to update my power search record rule to use channum but that<br>
> >> >failed.  So I guess I'll have to run the mysql query and find the chanid<br>
> >> >from the printout and just plug that into the Power Search.  I don't<br>
> >> >understand it, but it works.<br>
> >> ><br>
> >> >Jim A<br>
> >><br>
> >> It should be possible to use channum in a power search rule.  I would<br>
> >> suggest something like this:<br>
> >><br>
> >> program.title='College Football' and program.chanid not in (select<br>
> >> chanid from channel where channel.channum='1');<br>
> >><br>
> >> Change the channum '1' to the channel you want.  Note that the channum<br>
> >> field is actually a char field, so you need to provide a character<br>
> >> string not a number when using it.  Or use 'channum+0' to convert it<br>
> >> to an integer to use it in a numeric context.<br>
> >><br>
> >> Doing a more complex (and multi-table) query like that will slow down<br>
> >> the scheduler a little bit though.<br>
> >><br>
> >> As I understand it, power search SQL is done in the context of the<br>
> >> program table, and any reference to other tables has to use the name<br>
> >> of the table (like channel.channum, not just channum).  So I tested<br>
> >> the above SQL like this:<br>
> >><br>
> >> MariaDB [mythconverg]> select * from program where<br>
> >> program.title='College Football' and program.chanid not in (select<br>
> >> chanid from channel where channel.channum='1');<br>
> >> Empty set (0.001 sec)<br>
> >><br>
> >><br>
> > I seem to have a handle on this with the exception of the chanid's I have<br>
> > right now.  On a test system built with Master and only HDHR network<br>
> > tuners, I have the chanid equal to 1 + atcs major + '0' + atcs minor.  i.e.<br>
> > 22_2 becomes 12202.<br>
> ><br>
> > But on my production backend where I want these power searches, I have<br>
> > HDHR and Hauppauge WinTV-qualHD tuners.<br>
> ><br>
> > There I seem to have all the normal chanid  plus the weird ones that make<br>
> > no sense to me. For example channel, 22_2, is in the query output twice:<br>
> > chanid 12202 and 16223.<br>
> ><br>
> > So it sounds like I need a more complicated powersearch that uses channum<br>
> > to index the channel table so the result excludes any recording for either<br>
> > of the chanid's for channum 22_2.<br>
> ><br>
> > Jim A.<br>
> ><br>
> <br>
> Thanks for the help.  I ended up with this Power Search;<br>
> <br>
> program.title='College Football' and program.chanid not in (select chanid<br>
> from channel where channel.channum='28_1' or channel.channum='22_2')<br>
> <br>
> This gave me all the College Football games recorded except those on<br>
> channels 28_1 and 22_2 which are a lot of rebroadcasts of second tier teams.<br>
<br>
The channel table is alread available so you use the following,<br>
simpler query:<br>
<br>
program.title='College Football' and<br>
channel.channum not in ('28_1', '22_2')<br>
<br>
That's not tested, but should be close to what you need.<br>
<br>
David<br>
-- <br>
David Engel<br>
<a href="mailto:david@istwok.net" target="_blank">david@istwok.net</a><br><br></blockquote><div><br></div><div>This works also. Usually when I see SQL simplified, I can't read it, but in this case, it actually makes sense to me.</div><div><br></div><div>Thanks, this will allow me to use channel numbers that I understand vs. chanid which I don't understand.</div><div><br></div><div>Jim A</div><div> </div></div></div>