mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Docs: Fix help docs for SQL datasources (#66749)
Fix example queries for SQL datasources
This commit is contained in:
@@ -48,10 +48,10 @@ export function CheatSheet() {
|
||||
</li>
|
||||
<li>
|
||||
$__timeGroupAlias(column,'5m') -> cast(cast(UNIX_TIMESTAMP(column)/(300) as signed)*300 as
|
||||
signed) AS "e;time"e;
|
||||
signed) AS "time"
|
||||
</li>
|
||||
<li>$__unixEpochGroup(column,'5m') -> column DIV 300 * 300</li>
|
||||
<li>$__unixEpochGroupAlias(column,'5m') -> column DIV 300 * 300 AS "e;time"e;</li>
|
||||
<li>$__unixEpochGroupAlias(column,'5m') -> column DIV 300 * 300 AS "time"</li>
|
||||
</ul>
|
||||
<p>Example of group by and order by with $__timeGroup:</p>
|
||||
<pre>
|
||||
|
||||
@@ -32,8 +32,8 @@ export function CheatSheet() {
|
||||
</ul>
|
||||
Macros:
|
||||
<ul className={styles.ulPadding}>
|
||||
<li>$__time(column) -> column as "e;time"e;</li>
|
||||
<li>$__timeEpoch -> extract(epoch from column) as "e;time"e;</li>
|
||||
<li>$__time(column) -> column as "time"</li>
|
||||
<li>$__timeEpoch -> extract(epoch from column) as "time"</li>
|
||||
<li>
|
||||
$__timeFilter(column) -> column BETWEEN '2017-04-21T05:01:17Z' AND
|
||||
'2017-04-21T05:01:17Z'
|
||||
@@ -49,10 +49,10 @@ export function CheatSheet() {
|
||||
</li>
|
||||
<li>
|
||||
$__timeGroupAlias(column,'5m') -> (extract(epoch from column)/300)::bigint*300 AS
|
||||
"e;time"e;
|
||||
"time"
|
||||
</li>
|
||||
<li>$__unixEpochGroup(column,'5m') -> floor(column/300)*300</li>
|
||||
<li>$__unixEpochGroupAlias(column,'5m') -> floor(column/300)*300 AS "e;time"e;</li>
|
||||
<li>$__unixEpochGroupAlias(column,'5m') -> floor(column/300)*300 AS "time"</li>
|
||||
</ul>
|
||||
<p>Example of group by and order by with $__timeGroup:</p>
|
||||
<pre>
|
||||
|
||||
Reference in New Issue
Block a user