shanmuga kumar shanmuga kumar - 11 months ago 85
MySQL Question

How to get ending time last 1 hour data in mysql?

I have below table filed in varchar datatype, I want get the last one hour data from table time using mysql query
I have

PHP

$total = (double) $input * (double) $rate;
return number_format((double) $total, 2);


Jquery

total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);


PHP

$total = (double) $input * (double) $rate;
return number_format((double) $total, 2);


Jquery

total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);

Answer Source

Select the rows from your table with the datetime column value between current date and time and 1 hr before current time.

Query

select * from `your_table_name`
where `your_column_name` between date_add(now(), interval -1 hour) and now();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download