resolved monitor inout time SQL query