Johnny Johnny - 2 months ago 12
MySQL Question

MySQL return no results from select * where varchar="" query

I'm having issue with my study project for creating database in MySQL.
I've imported data using LOAD to my created table from a CSV file. Now when I'm executing

select * from mytable
everything show up perfectly, but when I execute
select * from bi_jogging.routes as r where r.Creator_Email="jhenderson7c@bbb.org"

I get nothing.

The email is there, I've tried different syntax options but it seems to be something else, I suspect something with the varchar format, I really have nothing in mind.

For other tables it works fine and others not.

Answer

You can try using the query:

select * from bi_jogging.routes as r where r.Creator_Email like "%jhenderson7c@bbb.org%"

If like operator shows the result then there may be white spaces in the email, please double check..

For join try this:

select * from bi_jogging.routes as r join bi_jogging.buddies as b 
on b.Email like '%r.Creator_Email%'