Johnny Johnny - 1 year ago 110
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=""

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 Source

You can try using the query:

select * from bi_jogging.routes as r where r.Creator_Email like ""

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%'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download