Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Wednesday October 03, 2007
07:46 AM

Broken SQL

[ #34598 ]

As it turns out, my previous query is terribly broken because of a bug in SQL. In the original relational model, only sets of data are returned, not bags (which allow duplicates). As it turns out, under the covers I'm getting duplicate results returned and summed. Fixing it turns out to be trivial ... if I had a new enough version of MySQL. 4.0.18 doesn't allow subselects.

I have several choices to fix it. I can try and invert it and use RIGHT JOINs or try and alter one of the tables to include some dates that are forcing one of the extra LEFT JOINs. I could also give up and fall back to summing a lot of the data in Perl, but that's much slower :(

I was supposed to have this data days ago. I hate SQL.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.