How to get last one hour data in MySQL ?

Last one Hour data in MySQL ?

Example :-

select o.code, o.customerId, c.name, c.email from `Order` o’;
join Customer c on c.id = o.customerId ‘;
where o.orderDate >= DATE_SUB(NOW(),INTERVAL <<SYNTAX>> HOUR) order by o.id limit 0, 2

Example :-

select o.code, o.customerId, c.name, c.email from `Order` o’;
join Customer c on c.id = o.customerId ‘;
where o.orderDate >= DATE_SUB(NOW(),INTERVAL 1 HOUR) order by o.id limit 0, 2

Related posts

Leave a Comment