I do agree that sql_response is the probe to use to get the results of an arbitrary query.
If you are operating on QoS though, going direct to the RN* tables is the incorrect approach. Consider that the name of the RN tables could (unlikely) change over time. The table id will definitely change over time - disovery_server will ensure that because of it's twitchiness.
As a result eventually your query criteria will break. The RN tables will become huge over time depending on the amount of data you keep - this SQL will potentially create a performance impact.
If you are intent on keeping this SQL and bypassing the SLA engine, then you need to tune this query - depending on your underlying database, you need to add nolock hints to the query at a minimum. Sub queries also create issues with the query optimizer and there is likely a much more efficient query than what is presented here - that tuning should be done on a system where you have a full set of test data - a table scan on a table with 2 days of data is going to be very different from one with 2 years.
You may also want to look at the snapshot table - this has the most recent value for each of the QoS which appears to be most of what your query is trying to calculate.
Also consider that the database structure is internal to the product - it is up to CA to decide what changes will happen in the next release. They have in the past changed the schema and the current schema is in a slow state of flux as it is with the introduction of the new database to store "big data".
The final thing to consider here is the system that these alarms will be tied to - it may make no difference but when sql_response creates the alarm, it will tag it with the robot/source/origin of the robot running sql_response which might not be where you want the alert to go.
-Garin