mysql query help

Hello

i have created mysql query to compare to values and get difference in percentage

as following:

SELECT file_name, 100 - ((100 * (SELECT file_count FROM xipi_files z WHERE x.file_group = z.file_group AND x.file_name = z.file_name AND z.insert_date =  CURDATE( )  - INTERVAL 1 DAY)) / (SELECT file_count FROM xipi_files z WHERE x.file_group = z.file_group AND x.file_name = z.file_name AND z.insert_date =  CURDATE( ) ) ) FROM xipi_files x WHERE insert_date = CURDATE( ) and file_group = 'net' and 100 - ((100 * (SELECT file_count FROM xipi_files z WHERE x.file_group = z.file_group AND x.file_name = z.file_name AND z.insert_date =  CURDATE( ) - INTERVAL 1 DAY)) / (SELECT file_count FROM xipi_files z WHERE x.file_group = z.file_group AND x.file_name = z.file_name AND z.insert_date =  CURDATE( ))) >2

i want also have data when value is more than -2

how to do that in simple way ? does mysql have +- 2 ?

regards

If I understand you, you want values >2, and values <-2?

If so you can use absolute value, which will convert negative numbers into positive ones so 3, -3, ... will also match >2.

SELECT ... WHERE ABS(...) > 2