The SQL below makes sense. However it is extremely slow. Am I right in thinking that a join (MySQL) could be used and that the code could dispense with the embedded Perl?
my $sql_count_A_Ref_vs_Comp = " SELECT '".$Reference."', '".$Comparitor."', A.entity_name FROM e_ann +otation_090812.annotation A WHERE A.user IN ( SELECT T.Line FROM e_annotation_090812.Temp_table T ) AND A.entity_name IN ( SELECT B.entity_name from e_annotation_090812.annotation B WHERE B.user IN ( SELECT U.Line FROM e_annotation_090812.Temp_table U ) AND B.entity_name LIKE '_%' AND B.evidence_code NOT LIKE +'%_________8__' AND B.centre LIKE '".$Reference."' ) AND A.entity_name LIKE '_%' AND A.evidence_code NOT LIKE '%______ +___8__' AND A.centre LIKE '".$Comparitor."' ";

In reply to s/Perl/SQL/ ? by Freezer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.