in sql take first todays record then other days record code example
Example: mysql where one year ago
select *
from orders
where order_date >= DATE_SUB(NOW(),INTERVAL 1 YEAR);
select *
from orders
where order_date >= DATE_SUB(NOW(),INTERVAL 1 YEAR);