in reply to Re: OT: MySQL combine 2 tables data when Perl 'fails'
in thread OT: MySQL combine 2 tables data when Perl 'fails'

Sadly MySQL is not Oracle and has only basic support for sub-selects. It is pretty annoying at times.

cheers

tachyon

  • Comment on Re: Re: OT: MySQL combine 2 tables data when Perl 'fails'

Replies are listed 'Best First'.
Re:**3 OT: MySQL combine 2 tables data when Perl 'fails'
by flounder99 (Friar) on Feb 11, 2004 at 17:53 UTC
    Just use a temporary table
    create table d SELECT tok, count FROM a UNION ALL SELECT tok, count FROM b; insert into c select tok, sum(count) as count from d group by tok; drop table d;

    --

    flounder