How to select all the data of variables into a SQL list

Hello everyone, Thanks for your time:
I am using Grafana V5.1.0.
up{host=“”, instance=“xxx”} up{host=“”, instance=“xxx”}
Assume i have a variable named hosts such as label_values(up, host), the value return is:
==> “”,“”
Now i wanna use this in my SQL script:
==> select ip from ip_table where ip not in (“”,“”)

I tried to use “ALL” option for my hosts, it works.
Questions is:
How can i set it to “ALL” default and forever,?
Because i will hide this variable and do not allow it to be not ALL.
Or is it possible for me to format the list of label_values(up, host) into one variable (“”,“”)?
Because i don’t need one single value of this list, i need all of them.

I checked the glob/regex/pipe/csv/lucene in “Advanced Formatting Options”.
But i can not find the right way.


Are you using a combination of prometheus and mysql? Please include the full request details from query inspector when you’re trying to use ${alive_hosts} in your sql query.