Jump to content

WHERE EQUALs Only Works on One of Two Tables


koopkoop

Recommended Posts

So I'm trying to run the basic MySQL command:

 

"SELECT * FROM products WHERE itemnumber = "23012NA"

 

on two different tables in the same database. The tables are "database" and "prices"

 

When I run it on "products", I get back one result - as expected.

 

However, I take the exact same query and run it on the "prices" table and it can't find anything.

 

So, I turn the query into "SELECT * FROM products WHERE itemnumber LIKE "%23012NA%" and all of a sudden it can find it. I checked the field for any leading or trailing spaces and there's none.

 

I'm so confused as to why I have to use %LIKE% to find it and EQUAL doesn't work.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.