I have a question about getting results after limiting the rows.
I don't have much experience with MySQL, but I'm trying to get results from a database where I need to do the where clause after limiting the results.
SELECT COUNT(measurement) as 'measurement errors' FROM measurelog WHERE (measurement < (baseline - tolerance)) ORDER BY Id DESC LIMIT 100
I only need the measurement values of the last 100 rows, so I expect to get about 5~10 results, but now the programm counts untill it has found 100 faulty measurements.
I've tried to switch the where clause to the bottom, but then I get an syntax error from the MySQL client.
Is there something I'm missing? Is there another way to do this?