0
This select returns me the oldest records to the future. But I wanted to exclude from the results the events that have already passed and first display the current event.
SELECT id, programa, descricao,data_hora
from wp_programacao
where id >= (SELECT programa
from wp_programacao
where data_hora <= now()
order by data_hora desc
limit 1)
order by data_hora asc
limit 5;
try to change
where data_hora <= now()
forwhere data_hora < now()
– BrTkCa
and why leave it as a quote, you didn’t write?
– BrTkCa
Yes... I’ll take it back
– Atila Silva
@Lucascosta keeps returning me the oldest record.
– Atila Silva