# Mysql variable head explosion

**URL:** <https://community.grafana.com/t/mysql-variable-head-explosion/82115>\
**Category:** MySQL\
**Tags:** dashboard-variables\
**Created:** [February 20, 2023, 7:09am UTC](https://community.grafana.com/t/mysql-variable-head-explosion/82115 "2023-02-20T07:09:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![solaceflooringsoluti](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@solaceflooringsoluti](https://community.grafana.com/u/solaceflooringsoluti)\
**Post date:** [February 20, 2023, 7:09am UTC](https://community.grafana.com/t/mysql-variable-head-explosion/82115/1 "2023-02-20T07:09:15Z")

</div>

How make variable work? What proper syntax? Docs are changing every week, cant find anything relative. Using mysql. Set variable query in settings. Pulling proper values.  
Trying to change table with variable dropdown, same database.  
Intention is to replace table name with variable, as i select.  
Why nothing works? Tried double wrapping curlies. Thx

```auto
SELECT 
       Str,
       CONCAT(Str, ' ') as Calls,
       SUM(CASE WHEN C_P = 'CALL' THEN Vol ELSE 0 END) AS call_vol,
       CONCAT(Str, ' ') AS Puts, 
       SUM(CASE WHEN C_P = 'PUT' THEN Vol ELSE 0 END) AS put_vol
FROM $t_2023_02_17
GROUP BY Str
Order BY str

```
