SQL expression help needed for creating new view. (1 Viewer)

nzdreamer55

MP Donator
  • Premium Supporter
  • August 31, 2010
    465
    28
    San Luis Obispo, CA
    Home Country
    United States of America United States of America
    Hi everyone,

    So I though I could just look at the SQL data base for MP-TVseries and make a simple change to get the view that I wanted, and while I am learning a lot about SQL, I have not been able to get what I am looking for. I am hoping that someone could take a look at what I have and help me understand why is isn't working and what to do to change it.

    Here is what I want. A view that will list shows that have been created with in the past X number of days, are unwatched and will be displayed like in the unwatched view with a hierarchy of series, season and episode. I would also love it if I could select which series got included. What I created below does not include the ability to show tagged series so just take that in mind when looking it over.

    series<;><Episode.FileDateCreated>;>=;<today-7><cond><Episode.Watched>;=;0<;><;><nextStep>season<;><;><Season.seasonIndex>;asc<;><nextStep>episode<;><;><Episode.EpisodeIndex>;asc<;>

    The output is all series which have unwatched episodes (Good). I can select a series to get to the season menu and see which seasons have unwatched episodes in them (Good kind of). When I select a season to see the unwatch episodes, only the seasons which have episodes that have been added in the last 7 days are displayed (Good kind of).

    So what I would like is that if the season does not have a recent episode in it, that this season will not show up.

    Do I need to put the <Episode.FileDateCreated>;>=;<today-7><cond> after the season<;>? Should I also include the <Episode.Watched>;=;0<;>? How would I include tagged series to only be displayed?

    Is there a intermediate reference that would be good for me to read about how SQL queries work here?

    Thanks
    -S
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    Seems correct with your view syntax, this is probably a bug in tvseries code where its not removing seasons that are empty.
     

    Users who are viewing this thread

    Top Bottom