Give me an example query sql for panel D3 Gauge table

give me an example query sql for panel G3 Gauge table

Thanks

Hey.

First of all, please close the similar/duplicate 2 topics regarding d3 gauge error. You cannot just create new topics slightly the same. It’s better if you edit an existing topic and trying to explain the problem/description more thorough.

In order for anyone to help you. Please include a link to the plugin you’re to use/are problematic (are you talking about D3 or G3? Then include the query in detail that you’re using.

Please refer to Using Grafana's Query Inspector to troubleshoot issues

Marcus

xhrStatus:"complete"
request:Object
method:"POST"
url:"api/tsdb/query"
data:Object
from:"1514757641147"
to:"1547265641000"
queries:Array[1]
0:Object
refId:"A"
intervalMs:21600000
maxDataPoints:1334
datasourceId:7
rawSql:"SELECT temperature as value, temperature as metric FROM tbl_grafana "
format:"table"
response:Object
results:Object
A:Object
refId:"A"
meta:Object
rowCount:3
sql:"SELECT temperature as value, temperature as metric FROM tbl_grafana "
series:null
tables:Array[1]
0:Object
columns:Array[2]
0:Object
text:"value"
1:Object
text:"metric"
rows:Array[3]
0:Array[99,99]
1:Array[76,76]
2:Array[34,34]

I moved your answer here. Did you noticed that you posted your response in the link I referenced??? Why did you do that?

What grafana version are you using?
What errors do you get?

Marcus

Grafana v4.6.3 (commit: 7a06a47e6)

Thanks.

Are you sure that you should use Format as Table and not Format as Time series? I have not used this plugin, but looking at its github repo it says

Data operator same as SingleStat panel (avg, sum, current, etc)

Which in my head sounds like you should use a proper time series query instead of a table query.

Marcus

Seems here you need to select only one value? Like SELECT TOP 1 ...

You may want to create an issue over at the plugin github repo for detailed questions?

Marcus

Error again

Alvianno

Seems like mysql don’t support SELECT TOP 1. You’ll need to remove TOP 1 and add LIMIT 1 between your WHERE and ORDER BY clause.

Marcus

You cannot query more than one variable, and alias will not work here.

You should use:
SELECT temperature
FROM tbl_grafana
WHERE date_insert = date_you_want_to_see AND $__timeFilter

And in the Options go to select Current as Data Operator and you can chose the measuring unit as well: