在LIKE中使用变量grafana进行查询 [英] Use variable grafana in query with LIKE

查看:108
本文介绍了在LIKE中使用变量grafana进行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用该工具的内部变量在LIKE中的 GRAFANA 中创建查询,用''通知变量的值,这会在postgres中的查询中生成错误,是否有任何建议?

I'm trying to create a query in GRAFANA with LIKE using the internal variables of the tool, but it informs the value of the variable with '' and this is generating an error in the query within postgres, any suggetions?

查询:

select count(*) from table_name where column_name like ('%'$VARIABLE'%') LIMIT 1

输出:

pq: syntax error at or near "'VALUE_VARIABLE'"

推荐答案

这是怎么回事:

select count(*) from table_name where column_name like concat ('%', $VARIABLE, '%') LIMIT 1

这篇关于在LIKE中使用变量grafana进行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆