Timestream: Make FROM clause depend on IF or CASE Statement

0

Hey there,

I'm working with a Grafana Dashboard querying Timestream Data and I am looking for a solution to do the following:

SELECT temperature
FROM 
if(${my_variable} = '1', "my-database"."my-table", "my-database-derived"."my-table-derived")

${my_variable} results from a variable in my dashboard. Dependent on that value, I want to request the data from either the regular database or the derived one.

How can I make that work?

Thank you for any help!

nico
已提問 6 個月前檢視次數 100 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南