in reply to Re^2: Simple sql query problem
in thread Simple sql query problem

That's why I think that you'll have better luck by submitting your query directly to mysql rather than through perl. It's always a good idea to get as close to the error as you can when you run into something you don't understand.