I am using the MySQL Workbench 5.2.34 to write queries that will be used later on a php site. A particular query that returns a NULL value has me stumped (perhaps I have hit the limit of Red Bull and am missing something obvious):
WHERE PartNumber IN (SELECT PartNumber FROM MANIFEST_ITEMS WHERE manifestid = '905712');
When I run the subquery independently, I get the expected results:
WHERE manifestid = '905712';
When I run the outer query independently (with sample data that is returned by the subquery), I get the expected results:
WHERE PartNumber IN ('MC024LL/A','MC373LL/A','MC375LL/A','MC371LL/A');
I think the issue is that in the third example, I have escaped my return values, but when the subquery is returning these values, they are not escaped. If that is the case, is it possible to automagically escape these subquery return values?
Interestingly I found this:
Querying MySQL database for strings containing forward slash | HOTORACLE
So evidently the issue is with the results that have a forward slash in the PartNumber. Is there a way to double quote the return results from a subquery?
I found the problem, my test data was bad!
So, the query above does work as expected! A big Sorry! to those who have looked and wasted their time.