SQL expressions in Grafana let you perform lightweight SQL-like transformations on the results of other queries — directly within the panel. This is great for reshaping, renaming, filtering, and aggregating data without modifying the original datasource query.
SQL expressions operate on the output of another query in the same panel, referenced by its query letter (e.g., A
, B
). These expressions are parsed and executed by Grafana — not sent to an external database.