2012-06-23, 11:32 PM
I'm still not sure why I struggle with SQL of all things. It must be a blind-spot of mine.
Anyway, to the point, I need to find the 'Next' programme to go along with a NOW/NEXT type of view. Doing NOW is easy and I thought NEXT would be too.
So what's wrong with this SQL query which basically tries to find 1 programme for each channel which hasn't started yet......it works and does only provide one programme for each channel but the start_time columns are showing me dates of either the 6th or 7th of July. It seems it's showing me the very last programme for each channel in my EPG_EVENT table whereas I obviously need the very first for each channel which hasn't started yet. :confused:
Cheers,
Brian
Anyway, to the point, I need to find the 'Next' programme to go along with a NOW/NEXT type of view. Doing NOW is easy and I thought NEXT would be too.
So what's wrong with this SQL query which basically tries to find 1 programme for each channel which hasn't started yet...
Code:
select * from epg_event where start_time >= datetime('now') GROUP BY channel_oid
Cheers,
Brian