Double single quotes

I’m trying to embed a variable in a SQL query, but I need the query as a string.

So I need, when selecting all values, instead of getting:
‘a’,‘b’,‘c’

I need two singe quotes:
‘‘a’’,’‘bb’’,’‘c’’

I have been looking at the formatting options, but even when I try to use the double quotes SQL/Grafana interprets them a bit different, where two single quotes together has a space between them, but the doulbequote option has them adjacent and the interpreter doesn’t like it

Compare doublequote:
image

To two single quotes (manually entered):
image

Why do you need them as such? is that how they are in the database?
How are you building the variables? statis or from db?

that is how you write a sql query