|
One thing you might try is having your application output the query (not the result.) Copy and paste it into your SQL monitor/enterprise manager/whatever you use and see what it returns. Then you will have a better idea of what you are doing. Any time I write an SQL query in code and I don't understand the results I'm getting, I always have my program tell me the actual query, and then I paste it into MySQL. After I have it tweaked to extract the data properly, then I put it back into my code.
By the way, don't use select * unless you need EVERY column returned.
|