How to get the average value of each second? MySQL
SELECT  LEFT(RealTime, 19) AS to_the_second,
        ROUND(AVG(AcX))  AS Average_AcX
    FROM some_table
    GROUP BY 1;


Notes:


Often it is practical to treat a datetime (or timestamp) as a string, as I am doing with the LEFT.
You may want to add the number of decimal places to the ROUND() function call.
The 1 in GROUP BY 1 is shorthand for 1st column (the LEFT...).