SELECT

Syntax

The query should be in the form of…

SELECT [RAW] <comma-separated asset list> FROM <comma-separated asset list> [ WHERE <date range or RECENT> [SPAN x] [SAMPLES x]]

Where asset and property names contain spaces, you should enclose your name in single quotes.

Note that you don't need the entire asset name. Internally your SQL query is converted into AQL, so partial matches will work.

Using Relationships

The JOIN option of your SELECT statement allows you to leverage ARDIs relationships in your query.

Non-Standard Extensions

Non-standard extensions to the SQL standard include the RAW, RECENT, SAMPLES and SPAN parameters.

Example Queries

SELECT * FROM `Power Monitor`

The current values of every point on the power meter.

SELECT Current FROM `Power Monitor` WHERE RECENT('1 day')

The current recorded at the power monitor for the last 24 hours

SELECT Current FROM `Power Monitor` WHERE time >= '2022-06-06 10:00:00' AND time ⇐ '2022-06-06 12:00:00' SAMPLES 200

The current recorded from the power monitor between two specific times, with 200 equally-spaced samples.

SELECT Current FROM `Power Monitor` WHERE time >= '2022-06-06 10:00:00' AND time ⇐ '2022-06-06 12:00:00' SPAN 120

The current recorded from the power monitor between two specific times, with 2 minutes (120 seconds) between each sample.

SELECT RAW Current FROM `Power Monitor` WHERE time >= '2022-06-06 10:00:00' AND time ⇐ '2022-06-06 12:00:00'

The raw data for power monitor current between the given times - no interpolation will be done.