If you have a complex query that uses many tables but does not return any rows, you should use the following procedure to find out what went wrong:
Test the query with explain to see if something is clearly wrong.
Select only the columns that are used in the WHERE clause.
Deletes 1 tables 1 times from the query until some behavior is returned. If the table is large, a good idea is to use limit 10 in the query.
A select query is issued for a column that has a row that matches a table that was last deleted from the query.
If you compare a float or double column with a numeric value of a numeric type, you cannot use the equality (=) comparison. This problem is common in most computer languages because not all floating-point values are saved with accurate precision. In some cases, you can correct the problem by changing float to double. See the a.5.8 section, "issues related to floating-point comparisons."
If you still can't find the problem, create a minimal test that runs with MySQL test < Query.sql, which displays the issue. You can create a test file by using the mysqldump--quick db_name tbl_name_1 ... tbl_name_n > query.sql dump table. Open the file in the editor, delete some inserted rows (if there are rows that are required to exceed the presentation problem), and add a SELECT statement at the end of the file.
Verify that the test file can demonstrate the problem by executing the following command:
shell> mysqladmin create test2
shell> mysql test2 < query.sql
Use Mysqlbug to post the test file to the Yo na General MySQL mailing list.