# Use part of the variable in mysql query?

**URL:** <https://community.grafana.com/t/use-part-of-the-variable-in-mysql-query/37761>\
**Category:** General\
**Tags:** templating, mysql\
**Created:** [October 9, 2020, 9:58pm UTC](https://community.grafana.com/t/use-part-of-the-variable-in-mysql-query/37761 "2020-10-09T21:58:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![deejayluk](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@deejayluk](https://community.grafana.com/u/deejayluk)\
**Post date:** [October 12, 2020, 4:56am UTC](https://community.grafana.com/t/use-part-of-the-variable-in-mysql-query/37761/4 "2020-10-12T04:56:55Z")

</div>

I think this topic is closed 🙂  
solution is below

> [@Trying to understand variables](https://community.grafana.com/t/trying-to-understand-variables/37688/20):
>
> I have found a solution. I used views in mysql.

---

_[View the full topic](https://community.grafana.com/t/use-part-of-the-variable-in-mysql-query/37761)._
