# Mysql connector Requirement

**URL:** <https://forum.bubble.io/t/mysql-connector-requirement/99570>\
**Category:** Plugins\
**Created:** [June 30, 2020, 6:00am UTC](https://forum.bubble.io/t/mysql-connector-requirement/99570 "2020-06-30T06:00:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sriram](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sriram/32/57307_2.png) [@sriram](https://forum.bubble.io/u/sriram)\
**Post date:** [June 30, 2020, 6:00am UTC](https://forum.bubble.io/t/mysql-connector-requirement/99570/1 "2020-06-30T06:00:45Z")

</div>

Hi All,

I would like to know if the below-mentioned query can be used in bubble SQL connector, It essentially requires the bubble to filling values at two levels using parameters, I have always performed a query where the parameters would be similar for both the table in Join.

Can bubble handle parameters for both the tables in join separately?

select  
parse\_client\_id,  
sum(spend) as spend\_ac,  
sum(clicks) as clicks,  
campaign\_modifier as campaign\_modifier  
from  
(SELECT  
\*  
FROM  
stats\_data.xxy  
where  
parse\_client\_id = ?  
AND date \>= ?  
AND date \<= ?  
AND dsp LIKE ? UNION ALL SELECT  
\*  
FROM  
stats\_data.xxz  
where  
parse\_client\_id = ?  
AND date \>= ?  
AND date \<= ?  
AND dsp LIKE ?) AS a  
group by parse\_client\_id , campaign\_modifier  
limit 200;

---

<div class="post-metadata">

**Author:** ![simon7](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/simon7/32/46991_2.png) [@simon7](https://forum.bubble.io/u/simon7)\
**Post date:** [June 30, 2020, 7:30am UTC](https://forum.bubble.io/t/mysql-connector-requirement/99570/2 "2020-06-30T07:30:25Z")

</div>

Bubble just sends the query to your db and looks at the response, so yes it should work. And not that this should be taken as critique, but why just not try it out instead of asking on the forum? You would find out immediately 🙂

---

<div class="post-metadata">

**Author:** ![sriram](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sriram/32/57307_2.png) [@sriram](https://forum.bubble.io/u/sriram)\
**Post date:** [June 30, 2020, 7:31am UTC](https://forum.bubble.io/t/mysql-connector-requirement/99570/3 "2020-06-30T07:31:49Z")

</div>

Hi @simon7

i tried it yesterday and it gave an error to check the syntax, Which is why i dropped in the form, Let me retry the same.

---

<div class="post-metadata">

**Author:** ![simon7](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/simon7/32/46991_2.png) [@simon7](https://forum.bubble.io/u/simon7)\
**Post date:** [June 30, 2020, 7:36am UTC](https://forum.bubble.io/t/mysql-connector-requirement/99570/4 "2020-06-30T07:36:19Z")

</div>

Thats what I hoped 🙂 Maybe try a simpler query first and work up from there. Sometimes it takes a bit of trial and error.  
You could also try writing you the stored procedure in your db and just call that. That would make the query much simpler in bubble.

Ps. To be honest I dont know if the sql connector supports stored procedures, but I believe it would.

---

<div class="post-metadata">

**Author:** ![joeyg](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@joeyg](https://forum.bubble.io/u/joeyg)\
**Post date:** [July 3, 2020, 10:46pm UTC](https://forum.bubble.io/t/mysql-connector-requirement/99570/5 "2020-07-03T22:46:44Z")

</div>

I have SQL queries like this working just fine in Bubble. Selects like this will work and you shouldn’t need to explore stored procedures. To get the syntax correct, get the SQL to work first in your SQL development environment and then cut/paste it exactly into the Bubble query, replacing the values with ? as Bubble parameters (for MySQL that is). You also might want to try using parentheses around each select statement.
