MySQL joins are not case-sensitive!

Reply
Highlighted
Yellow Belt

MySQL joins are not case-sensitive!

I just realized that joins in SQL in DOMO are not case sensitive! This is a huge problem for me and my team. Here's an example:

 

table_1:

teammanager_id
SalesJohn123
MarketingJoe341

 

table_2:

locationmanager_id_2
MichiganJohn123
CaliforniaJOhn123
TexasJOHN123

 

 

select

table_1.*,
table_2.*

from table_1

left join table_2 on table_1.manager_id = table_2.manager_id_2

 

I get:

teammanager_idlocationmanager_id_2
SalesJohn123MichiganJohn123
SalesJohn123MichiganJOhn123
SalesJohn123MichiganJOHN123
MarketingJoe341  

 

Can anyone tell how to make the join case sensitive?

Highlighted
Red Belt

Hi @user022825 

 

You can utilize the BINARY keyword to force MySql dataflow to do a case sensitive join.

 

select

table_1.*,
table_2.*

from table_1

left join table_2 on BINARY table_1.manager_id = table_2.manager_id_2


**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**
Announcements
Domopalooza 2021 Call for Presenters: We want to hear how Domo is revolutionizing the way you do business!

Click here to submit your story.