Hi,
I have this:
I would like the name “Mes Corriente” and “Mes anterior” to be dynamic with a case statement in SQL.
It’s possible?
Welcome,
it is possible but this is more of a SQL question than a grafana question.
Can you please post DDL and DML
--DDL
create table #sample(yadi int, yada float, yodo varchar(50))
--DML
insert into #sample
values(1, 3.5,'habichuela')
Thank u!
Well, reading again I think I expressed myself wrong.
What I’m looking, for example, is this:
SELECT COUNT(Asistentes) as (MONTHNAME(CURRENT_DATE()))
Let’s see if I understood. I use mysql. The table is already created with saved data.
Image:

Do I have to create some stored procedure or view inside SQL and then from Grafana call that view to be able to do it?
Well you still have not provided the DDL and DML so it is hard to guide you. Since we do not have access to your mysql, we would need the table schema (not an image) and sample data to emulate your data in our mysql.
CREATE TABLE indicadores (
Asistentes` INT(11) NULL DEFAULT NULL
)
INSERT INTO indicadores (Asistentes) VALUES (1)
Muchas gracias! Es lo que necesitaba