import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; export function CheatSheet() { const styles = useStyles2(getStyles); return (

MySQL cheat sheet

Time series: Optional:

Resultsets of time series queries need to be sorted by time.

Table: Macros:

Example of group by and order by with $__timeGroup:

        
          $__timeGroupAlias(timestamp_col, '1h'), sum(value_double) as value
          
FROM yourtable
GROUP BY 1
ORDER BY 1
Or build your own conditionals using these macros which just return the values:
); } function getStyles(theme: GrafanaTheme2) { return { ulPadding: css({ margin: theme.spacing(1, 0), paddingLeft: theme.spacing(5), }), }; }