If a complex query of many tables is used, but no rows are returned, perform the following steps to identify the error:
Use EXPLAIN to test the query to check whether a clear error has been found. Select only the columns used in the where clause.
Delete one table once in the query until some rows are returned. If the table is large, it is better to use LIMIT 10 in the query.
For columns with rows that match the table deleted from the last query, a SELECT query is sent.
If you compare FLOAT or DOUBLE columns with numeric values, you cannot use equality (=) for comparison. This problem is common in most computer languages because not all floating point values can be saved with accurate precision. In some cases, changing FLOAT to DOUBLE can correct this problem. See section A.5.8, "Issues related to floating point comparison ".
If you still cannot find out the problem, create a mysql test query. SQL dump table that can match the problem to create a test file. Open the file in the editor, delete some inserted rows (if there are rows beyond the required for demonstration), and add the SELECT statement at the end of the file.
Run the following command to verify that the test file demonstrates the problem:
Shell> mysqladmin create test2
Shell> mysql test2 <query. SQL
Use mysqlbug to post the test file to the Yona universal MySQL mail list.