+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Another SQL question

  1. #11
    Join Date
    May 2006
    Location
    Canada
    Posts
    17,891
    Quote Originally Posted by ACTCMS View Post
    Very elegant Martin unfortunately, there seems to be no guarantee that the EPG_EVENT oid is in the same sequence as start_time (at least not on my system)

    Alex
    Thanks, I was going to mention that the XMLTV source had to actually be in date order for that to work and for OTA EPG it might not but I didn't have any source to confirm.

    Martin

  2. #12
    Join Date
    May 2006
    Location
    Canada
    Posts
    17,891
    Maybe this

    Code:
    select * from epg_event,
    (select min(start_time) as start_time,channel_oid
    from EPG_EVENT
    where start_time > datetime('now')
    group by channel_oid) next
    where epg_event.start_time = next.start_time
    and epg_event.channel_oid = next.channel_oid
    Martin

  3. #13
    Join Date
    Oct 2011
    Location
    UK
    Posts
    60
    Quote Originally Posted by mvallevand View Post
    Maybe this

    Code:
    select * from epg_event,
    (select min(start_time) as start_time,channel_oid
    from EPG_EVENT
    where start_time > datetime('now')
    group by channel_oid) next
    where epg_event.start_time = next.start_time
    and epg_event.channel_oid = next.channel_oid
    Martin
    that only shows the 'next' on my system.

  4. #14
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,045
    Quote Originally Posted by mvallevand View Post
    Maybe this
    Martin, I think you might have missed my post at #10 of this thread. It took a while to type as I was doing it between helping my wife with some chores and I think you missed it as you responded to Alex's post.

    Cheers,
    Brian

  5. #15
    Join Date
    May 2006
    Location
    Canada
    Posts
    17,891
    Quote Originally Posted by odin View Post
    that only shows the 'next' on my system.
    Wasn't that what bgowland asked for?

    Martin

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts